finish dos command before continuing with the next Matlab command

In the middle of my Matlab m-file, I have this code:
system('start model.exe');
At this point I want to finish running the model.exe first then continue with the next matlab command in the m.file. But this is not happening. M-file is terminated at this point because it jumps to the next line befor completing model.exe. Any Idea?
Update: Why I added start was because I did not want the progress of the model.exe printed in Matlab Command Window. Do you know other way how I can prevent printing of the .exe?

 採用された回答

Guillaume
Guillaume 2015 年 7 月 20 日

0 投票

Just get rid of the start. That is just use:
system('model.exe');
Per start documentation, it starts a new process to run the executable. As a result, the command window spawned by matlab completes immediately.

3 件のコメント

Meh
Meh 2015 年 7 月 20 日
Thank you Guillaume. Why I added start was because I did not want the progress of the model.exe printed in Matlab Command Window. Do you know other way how I can prevent printing of the .exe?
Guillaume
Guillaume 2015 年 7 月 20 日
Possibly,
system('start model.exe /wait');
Again, refers to the documentation of start.
Meh
Meh 2015 年 7 月 20 日
Thanks again it worked with this one:
system('start /wait model.exe ');

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDebugging and Analysis についてさらに検索

タグ

質問済み:

Meh
2015 年 7 月 20 日

コメント済み:

Meh
2015 年 7 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by