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
hi.
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
usually you use [shell] with a script that does everything by itself and which does not take any arguments.
e.g.
<snip> #!/bin/sh ## run matlab from here and tell it immediately to execute a .m file which reads in the matrix and does whatever it does and write it out to another file ... ## do something with the outfile, so [iemmatrix] can handle it ...
</snip>
then you just run this script via [shell].
the good thing about this is, that you can debug the script separately from the integration into the patch.
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?
i don't know which commands you are giving to matlab.
note however, that you cannot talk to the program started with [shell] once it is running (e.g. via stdin); i guess you are trying to do something like that.
mga.dsf IOhannes
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@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Franz Zotter wrote:
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.
but usually you don't need this to do: if you have only one operation you want to be executed by a remote application (and i expect gerda's problem to be like that), you are better off with using a simple shell-script without any hacks.
(of course it would be nice if you wouldn't need any hacks, but currently you do)
m,fg.adr IOhannes
Maybe you should consider using pyext instead of shell.
aalex
On 9/21/06, IOhannes m zmoelnig zmoelnig@iem.at wrote:
Franz Zotter wrote:
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.
but usually you don't need this to do: if you have only one operation you want to be executed by a remote application (and i expect gerda's problem to be like that), you are better off with using a simple shell-script without any hacks.
(of course it would be nice if you wouldn't need any hacks, but currently you do)
m,fg.adr IOhannes
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
carmen wrote:
On Sat Sep 23, 2006 at 11:35:17PM -0400, Alexandre Quessy wrote:
Maybe you should consider using pyext instead of shell.
or expect, via pd-gui. afaik it was developed for the purpose of controlling other programs..
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
using [shell] and a script that contains : ./matlab -nosplash -nodesktop -r "matlabfunction(${1}), quit" plus sending a message to [netreceive] now works perfectly for me!
Gerda