Executing unix commands in R2012a
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Walter Roberson
il 17 Gen 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.
Più risposte (1)
Jan
il 17 Gen 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 Commenti
Jan
il 17 Gen 2013
Can you modify the program? The some output could reveal, where the program fails.
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!