how to running MATLAB commands from DOS

1 view (last 30 days)
Efrat amarel
Efrat amarel on 1 Sep 2015
Answered: Walter Roberson on 1 Sep 2015
hello, How to execute "MATLAB commands" from DOS without typing/ touch on MATLAB command prompt. I want run .m file and the commands in this file will perform.
Is it possible to do so? thanks!

Answers (1)

Walter Roberson
Walter Roberson on 1 Sep 2015
"C:\path\to\matlab.exe" -nodesktop -r "try; NAMEOFMFILE; catch ME; end; quit"
for example,
"C:\Programs (x86)\MATLAB2014b\bin\matlab.exe" -desktop -r "try; spaceinvaders; catch ME; end; quit"
Notice the ".m" extension is not to be given.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!