How can I execute an M-file from Windows' command line without opening MATLAB's Command Window?
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 11 Jul. 2018
Beantwortet: MathWorks Support Team
am 12 Jul. 2018
I want to run a MATLAB script, but I do not want any GUI to be opened.
Currently, if I do the following:
> matlab -nosplash -nodesktop -r "x = 5; save('test.mat');"
it will still open MATLAB's Command Window.
Akzeptierte Antwort
MathWorks Support Team
am 11 Jul. 2018
You can either:
1. Include the "exit" command:
> matlab -nosplash -nodesktop -r "x = 5; save('test.mat'); exit"
This will however still leave the Command Window open until your script finishes.
2. Using MATLAB COM Automation Server (in VBScript)
You can refer to the first answer of the following thread for more information about this workaround:
3. Using MATLAB Compiler
Compiling your code into an executable, which can then be executed would be the closest solution to the workflow you are trying to achieve.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!