1

R can be run on the command line in at least two ways. One is to use the interactive interpreter, by typing R on the command line. Another is to run a script and quit, by using Rscript Foo.r. Is it possible to run matlab in a mode where it runs a script and quits?

I apologize if this is a newb question but I googled around, and tried to do matlab --help and man matlab, and I cannot figure it out.

merlin2011
  • 71,677
  • 44
  • 195
  • 329

1 Answers1

0

Use run(filename) or echodemo filename in the command line.

You can also run this command:

C:\<a long path here>\matlab.exe" -nodisplay -nosplash -nodesktop -r "run('C:\<a long path here>\filename.m');

You can refer to details here to run matlab in batch mode too.

Community
  • 1
  • 1
lennon310
  • 12,503
  • 11
  • 43
  • 61