[PD] execute matlab using [shell] object

Franz Zotter zotter at iem.at
Wed Sep 20 21:51:49 CEST 2006


Hi Gerda,

you need to use matlab's commandline option '-r' to execute commands after 
startup, and to close it afterwards.

one of the problems is that you can't write ';, into pd-messages without 
bbogart's entry, or editing .pd files by hand. 

if you have got:

[matlab -r 'rand(20)\, quit'(
[list2symbol]
[list trim]
|
[shell]
| 
[print STDOUT]

it will work!

try the patch in the attachment.

franz.



On Wednesday 20 September 2006 18:32, Gerda Strobl wrote:
> Dear all,
>
> I'd like to execute a matlab file using the shell object.
> The standard command I use ist
> /usr/local/matlab7/bin/./matlab -nodisplay -nosplah.
>
> Sending such a message to the shell object - I only get the info that
> the program starts on the pd-shell:
> STDOUT: < M A T L A B >
> STDOUT: Copyright 1984-2004 The MathWorks
> STDOUT: Inc.
> STDOUT: Version 7.0.0.19901 (R14)
> STDOUT: May 6
> STDOUT: 2004
> STDOUT: Warning: Duplicate directory name: /home/gerda/matlab.
> STDOUT: To get started
> STDOUT: type one of these: helpwin
> STDOUT: helpdesk
> STDOUT: or demo.
> STDOUT: For product information
> STDOUT: visit www.mathworks.com.
> STDOUT: >>
> DONE: 0
>
> but there is no chance, to send it more options (change dir, set a
> paramater). So nothing.
>
> Has someone done this already? (I know there is pdoctave, but octave is
> too slow).
> Or do iI treat the shell object in a wrong way? Or is it simply not
> possible? (I'd like to recalculate a matrix in matlab and then write a
> *.mtx file  back to my pddirectory, in order to use it  wth the iematrix
> objects).
> Or do I give matlab the wrong commands?
>
> Help would be great!
> Thanks,
> Gerda
>
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list

-- 
DI Franz Zotter
Tel.: +43(0)316/389 - 5219
Universität für Musik und darstellende Kunst
Institut für Elektronische Musik und Akustik
A-8010 Graz
-------------- next part --------------
#N canvas 339 433 910 378 10;
#X obj 89 215 shell;
#X obj 130 242 print DONE;
#X obj 22 245 print STDOUT;
#X text 75 18 Hi gerda \, you can write these characters using bbogart's
entry external and list2symbol;
#X obj 446 150 entry 124 100 grey70 black;
#X obj 495 130 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X msg 466 93 set matlab -nosplash -nodesktop -r 'zufall=rand(1\,3)\,
quit';
#X text 41 66 unfortunately the message doesn't store it as a symbol
;
#X msg 28 117 matlab -nosplash -nodesktop -r 'zufall=rand(1\,3)\, quit'
;
#X obj 28 161 list2symbol;
#X obj 28 182 list trim;
#X obj 460 270 list prepend set;
#X obj 464 292 list trim;
#X msg 461 315;
#X connect 0 0 2 0;
#X connect 0 1 1 0;
#X connect 4 0 9 0;
#X connect 4 0 11 0;
#X connect 5 0 4 0;
#X connect 6 0 4 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 0 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;


More information about the Pd-list mailing list