Executing unix commands in R2012a

4 views (last 30 days)
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.

Accepted Answer

Walter Roberson
Walter Roberson on 17 Jan 2013

More Answers (1)

Jan
Jan on 17 Jan 2013
"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 Comments
Tue
Tue on 17 Jan 2013
Hopes this clarifies: [status,result]=unix('program.exe < input > output') returns status=0, result='STOP program.exe terminated with an error'. As such no 'real' error message, but the program do not execute in R2012a. It does in R2010 or if the command is typed directly in the terminal in that folder. Therefore it is not a system related issue by itself related to memory or permissions, but a system related issue with R2012a only. Do you have a suggestion to how I can squeeze more information out of the problem?
Jan
Jan on 17 Jan 2013
Can you modify the program? The some output could reveal, where the program fails.

Sign in to comment.

Categories

Find more on Software Development Tools in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!