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');
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.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

태그

질문:

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