Dear all,
I would like to know if MATLAB is able to run the multiple exe simultaneously. If yes, how to run it?

 採用された回答

Voss
Voss 2022 年 2 月 21 日

1 投票

Yes, you can use "&" to return control to MATLAB immediately after the exe starts. Then you can immediately run an exe again. For instance:
!excel.exe &
!excel.exe &
That would start two instances of Excel.

5 件のコメント

xiaohuo
xiaohuo 2022 年 2 月 21 日
Thanks for your suggestion.
Do you mean to use the "!" + "**.exe"+ "&" ?
Voss
Voss 2022 年 2 月 21 日
You can construct the command using string concatentation, yes.
Or you can use system() to run the exe with " &" on the end.
xiaohuo
xiaohuo 2022 年 3 月 1 日
the code does not work. Any suggestions?
cmd_H01 = 'H1_L01.exe'; % Path of hh-1D.exe
cmd_H02 = 'H1_L02.exe'; % Path of hh-1D.exe
system('cmd_H01; cmd_H02');
Walter Roberson
Walter Roberson 2022 年 3 月 2 日
system(strjoin({cmd_H01, cmd_H02}, ';'))
xiaohuo
xiaohuo 2022 年 3 月 2 日
system([cmd01,'&',cmd02]);
This works well!
Thanks!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 2 月 21 日

1 投票

As .exe are specific to Windows, you could consider using .NET System.Diagonstics.Process to create the processes and control them.

3 件のコメント

xiaohuo
xiaohuo 2022 年 2 月 21 日
Would you please give an example? for instance, "test66.exe", how to run this exe?
for i=1:6
cmd_H1D = 'test66.exe';
system(cmd_H1D);
end
xiaohuo
xiaohuo 2022 年 3 月 10 日
Thanks.

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

カテゴリ

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

製品

タグ

質問済み:

2022 年 2 月 21 日

コメント済み:

2022 年 3 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by