How to make Matlab close automatically

조회 수: 3 (최근 30일)
JFz
JFz 2016년 7월 18일
댓글: dbmn 2016년 7월 28일
Hi,
I have a .bat file that should start matlab and run an application, then close matlab. It has one line:
matlab -nodesktop -r runMyapp; exit;
It execute the job smoothly but after the execution, it does not close matlab. It seems like the exit does not do anything here.
What is the right way to make the matlab close automatically?
Thanks for any help.
Jennifer

답변 (1개)

dbmn
dbmn 2016년 7월 28일
Have you tried running your sequence of commands with quotation marks?
matlab -nodesktop -r "runMyapp; exit;"
Alternatively you could add exit to the end of your runMyapp script...
  댓글 수: 2
JFz
JFz 2016년 7월 28일
편집: JFz 2016년 7월 28일
Thank you so much!
What is the difference of this expression from the previous one?
dbmn
dbmn 2016년 7월 28일
When using quotation marks the whole sequence of commands between the quotation marks is fed into the -r option.
When you do not use them - I am not sure, but I think - it just executes your command until the blank space/semicolon and then tries to interpret the next command as an additional option (and fails to do that).
Maybe someone can confirm this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by