How to run MATLAB files in batch mode or as a batch process
39 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 18 Mai 2017
Réponse apportée : MathWorks Support Team
le 24 Mai 2017
How do I run a MATLAB script or function in batch mode in Windows?
Réponse acceptée
MathWorks Support Team
le 18 Mai 2017
You can use the following command to run a MATLAB script in batch mode from the Windows Command Prompt:
matlab -nosplash -noFigureWindows -r "try; run('C:\Path\To\YourScriptName.m'); catch; end; quit"
To be safe, "YourScriptName.m" should have instructions to cd() to the directory it is to work in. The command "run" cannot be used with functions but only with scripts. For functions please use the following syntax:
matlab -nosplash -noFigureWindows -r "try; cd('C:\Path\To\'); YourFunctionName(); catch; end; quit"
The above commands could be put into a BAT file and invoked from any directory.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!