Executing unix commands in R2012a
4 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Walter Roberson
on 17 Jan 2013
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.
More Answers (1)
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
Jan
on 17 Jan 2013
Can you modify the program? The some output could reveal, where the program fails.
See Also
Categories
Find more on Software Development Tools in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!