필터 지우기
필터 지우기

dos/system error

조회 수: 4 (최근 30일)
Dustin
Dustin 2011년 5월 25일
I am trying to run an EXE from the MATLAB (r2010b on Windows XP) command prompt, and am not able to do so.
I can easily use
dos('dir');
and list the contents of the directory, but running my EXE like:
dos('segment 0.8 100 100 tmpim1269868.ppm tmpimsp1269868.ppm');
does not work. The command prompt is available to me almost instantaneously, and the ans variable contains the value -1.0737e+9.
I am able to run the EXE from a DOS prompt with the exact same command, and generate the correct result, but when the DOS prompt is called from MATLAB, it just doesn't seem to be working. I have tried creating a BAT file containing the execution call in the directory and running the same by using the dos command, but to no avail.
The same occurs when I use system instead of dos.
Any advice at all would be appreciated.

채택된 답변

Dustin
Dustin 2011년 5월 25일
OK, I think I missed the most obvious thing. I just restarted MATLAB and everything is hunky-dory. Code's running absolutely fine now.

추가 답변 (1개)

Jan
Jan 2011년 5월 25일
Do you catch the 2 output arguments from the DOS command? ANS should be 0 for successful processing, and not 0 otherwise. Try:
[a, b] = system(['segment 0.8 100 100 ', ...
'tmpim1269868.ppm tmpimsp1269868.ppm']);
Are you sure that "segment.exe" and the picture(s) is(are) available in the current folder? Does an error message appear in the output [b]?
  댓글 수: 1
Dustin
Dustin 2011년 5월 25일
Hi Jan,
Thanks for your reply.
I tried this and a is -1.0737e+9, while b is ''. So no new information available.
Yes, the EXE and the image are available in the folder. If the image is not available, the program outputs "loading input image" and exits. I do not get any output at all from the program though, so I am finding it really difficult to find out what's going wrong.

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

카테고리

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