Matlab 2019b handle through script

8 次查看(过去 30 天)
ssingh
ssingh 2021-11-26
回答: Les Beckham 2021-11-26
I want to automate Matlab tool, like start the matlab, add some startup scipt and close the Matlab. Is there any way or library through which i can automate MATLAB Tools. Could you please help me. I was trying with Pywin Auto Tools but unfortunatly not able to connect with Matlab tools so its not working properly.

回答(1 个)

Les Beckham
Les Beckham 2021-11-26
Depending on your OS, read one of these two solutions:
Both use the /r (or -r) command line argument when starting Matlab, and pass the command (script or function) to run when starting Matlab. If you want Matlab to exit when the script or function is finished, simply put the exit command at the end of that script or function. Of course, that script or function must exist and be on the Matlab path. There is a lot more detail in the links, especially the first one (most of which applies to both Windows and Linux).
Example (Windows):
matlab /r YourScript
You can put this in a bat file or a shell script with whatever additional processing you need.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by