running matlab using command line
737 次查看(过去 30 天)
显示 更早的评论
I am running matlab using Command line and using the following command to run the matlab.
"C:\Program Files\MATLAB\R2017b\bin\matlab.exe" -nodisplay -nosplash - nodesktop -r "run('Main.m');"
What should I add to this command to make sure Matlab doesn't get open and it just runs behind the scene and close automatically?
3 个评论
Jan
2018-7-10
"C:\Program Files\MATLAB\R2017b\bin\matlab.exe" -nodisplay -nosplash - nodesktop -r "Main; exit"
回答(3 个)
Jan Siegmund
2020-3-26
For R2019 users: -nodisplay & -nodesktop do not exist. Use:
matlab -batch "Main; exit"
2 个评论
Matthias
2020-8-5
Hi Jan, do you know how to prevent Matlab from opening that separtate Command Prompt window when launching it from the command line from R2019 and upwards?
Thanks!
Jan Siegmund
2020-8-5
I'm not exactly sure what you mean. For me, this does not open a separate command prompt. The command starts the Matlab prompt, executes main, executes exit and returns to the system shell. Do you want to omit the Matlab command prompt?
Lorenzo Luini
2024-4-1
I am running a Matlab script at startup using the command as follows:
matlab.exe -r "run('C:\Users\User\Desktop\Realtimevis\RealtimeMeteoVisualization.m');"
The script opens up a figure to display some measurements in real time. How can I hide the Matlab command window while allowing the script to show the figure?
Thank you!
Best regards,
Lorenzo
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!