Executing unix commands in R2012a
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi... I have for several versions executed a fortran program from matlab using !program.exe < input > output unix('program.exe < input > output') system('program.exe < input > output') without any problem. Updating to R2012a now returns 'STOP program.exe terminated with an error' for all of these. I have several versions of matlab installed and the error only occurs on my newest R2012a. The unix command executes correctly if I manually execute the command in the current folder. Also the $PATH is correct when displayed in matlab with unix('echo $PATH') and the program path is correctly found from '!which program.exe'. It must somehow be related to the nature of the fortran program since I can make other programs execute correctly. Are there any assumptions on the nature of the executed command in matlab? Any hint to what the error might be would be greatly appreciated.
댓글 수: 0
채택된 답변
Walter Roberson
2013년 1월 17일
See http://www.mathworks.co.uk/matlabcentral/answers/43640-a-peculiar-problem-when-using-system-command-to-run-a-c-shell-script-from-matlab and follow through to Ben's work-around.
추가 답변 (1개)
Jan
2013년 1월 17일
"Stopped with an error" sounds like it would be rather useful to see the corresponding error message. Perhaps a file is missing, the current folder is write protected or the memory is exhausted. Without seeing a message, there could be 1000th of reasons and it is impossible for you and for us to guess any details.
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!