Can't run an external program with arguments

조회 수: 2 (최근 30일)
Joshua
Joshua 2020년 8월 5일
편집: Mario Malic 2020년 10월 13일
This question is closely related to:
Executing the following command in Matlab (R2019a) causes a not repsponding error in my external program to appear
cmdStr1 = ['"C:\Program Files (x86)\SGeMS\sgems-x64.exe"']
system(cmdStr1)
Using the answer in [1] from:
Philipp Krauter on 30 Dec 2018
I can successfully get Matlab (R2019a) to execute my program using the following
cmdStr2 = ['set path=%path:C:\Program Files\MATLAB\R2018b\bin\win64;=% & "C:\Program Files (x86)\SGeMS\sgems-x64.exe"']
system(cmdStr2)
However as soon as I include the arguments
cmdStr3 = ['set path=%path:C:\Program Files\MATLAB\R2018b\bin\win64;=% & "C:\Program Files (x86)\SGeMS\sgems-x64.exe" -s tiGenerator.py']
system(cmdStr3)
I get the initial not responding error again.
This appears to be an issue with Matlab as I can execute the command successfully in the command line.
Note, using the suggestion of dos() from Image Analyst results in the same error
Any help would be appreciated!
  댓글 수: 8
Ana Fernández
Ana Fernández 2020년 10월 13일
Hi @MarioMalic, problem solved thanks to your assistance. The program runs with system('POSC2.exe'); I changed the path to the program and that's it.
Mario Malic
Mario Malic 2020년 10월 13일
편집: Mario Malic 2020년 10월 13일
That's great to hear. Usually, you wouldn't run the program from its directory. You should try it from some other directory where you're writing the code. Probably, the software could not be opened maybe due to the read/write access in the current directory, as any files that program generates (session file), will be within the current directory of MATLAB.
I just wanted to check whether it's possible to call it within the program folder. This might indicate an issue with your paths, or r/w access as mentioned above.

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

답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by