running matlab script from command prompt not taking all parameters for startup.m

时间:2015-09-01 22:51:50

标签: matlab

I run a script in folder

C:\SVN\myscripts\tst1.m

with following command on cmd.exe( Win 7)

"C:\Program Files\MATLAB\R2013b\bin\matlab.exe" -nosplash -nodesktop -wait -minimize -r "tst1"

This executes fine. However, as mentioned in the "help" document, I can specify multiple scripts/functions like

"C:\Program Files\MATLAB\R2013b\bin\matlab.exe" -nosplash -nodesktop -wait -minimize -r "tst1, exit"

This worked too.

However, if the same is done on startup.m file( my own file which sets some paths before calling some other Matlab Scripts) that is located as

C:\SVN\myscripts\StartupScript\startup.m

in following manner( after changing pwd to above folder):

"C:\Program Files\MATLAB\R2013b\bin\matlab.exe" -nosplash -nodesktop -wait -minimize -r "startup, exit"

The Startup.m does execute all its contents sucessfully, but at the end of it, I get following message :

Undefined function or variable 'startup'.

and Matlab returns the control to command prompt with non zero exit code.

Any reasons for this kind of behavior.
Thanks
sedy

0 个答案:

没有答案