PDA

View Full Version : autoexit after script runs


jmabie
25 Apr 2008, 11:36pm
Hello
I have a matlab scritp that is called from a shell script. The problem is that matlab will not exit after the script is finished executing and so the driving shell script hangs. I've tried 'quit' and 'exit' at the end of the matlab script and after the call to matlab in the shell scritp and nothing seems to work. Does anyone know how to force matlab to quit from within the script?
thanks

shwaip
26 Apr 2008, 5:38pm
it sounds like the script isn't reaching the end (hence why exit and quit aren't helping). If you run the script from within matlab, does it finish properly?

jmabie
27 Apr 2008, 1:24am
Yes, when I run it directly, the script finishes, exits, and returns to the MATLAB command prompt. I can them manually quit with no problem. The problem is that the driving shell script doesn't know the code is finished because MATLAB just sits idle instead of exiting. What I need to be able to do is to exit MATLAB from within an executing MATLAB program or something like that (ie: exit the program and then exit MATLAB automatically). Thanks for the help.