DSPRelated.com
Forums

Running M-File from Command Line?

Started by Unknown September 23, 2004
Is there a way to invoke Matlab to run a single m-file?
The purpose is to be able to "build" matlab output files
from a make file.
-- 
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
Randy Yates wrote:
> Is there a way to invoke Matlab to run a single m-file? > The purpose is to be able to "build" matlab output files > from a make file.
matlab -r matlab_cmd I haven't done this since version 3.5 or so, so you might need to play with it. matlab -help does work for release 14 running in linux.
Stan Pawlukiewicz <spam@spam.mitre.org> writes:

> Randy Yates wrote: > > Is there a way to invoke Matlab to run a single m-file? > > The purpose is to be able to "build" matlab output files > > from a make file. > > > matlab -r matlab_cmd > > > I haven't done this since version 3.5 or so, so you might need to play > with it. > > > matlab -help does work for release 14 running in linux.
Thanks Stan. The following did it: matlab -r mymatlabfunction -nodesktop -nojvm -nosplash <exitcmd.txt where "exitcmd.txt" is: exit It's MUCH faster getting in and out, too. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Randy Yates wrote:

> Is there a way to invoke Matlab to run a single m-file? > The purpose is to be able to "build" matlab output files > from a make file.
Can't answer this specific question, but if your m file is appropriately constrained, then you can certainly run it from octave at the command line. I frequently use it from make files in exactly this way, for building dependent coefficient tables, and the like. (Actually, I'm moving towards using Python for this purpose, because it's more readily available, thanks to simpler licence conditions. It does have its own limitations, though, so the move is gradual...) -- Andrew
> (Actually, I'm moving towards using Python for this purpose,
When we decide to use Platform like Python instead of Matlab, we should not forget the running speed which is now very high in Matlab because it can compile m-codes very effectively. -- Best regards, James K. (txdiversity@hotmail.com) [Home] http://home.naver.com/txdiversity