|
Answer» I am using a DOS batch file to execute SEQUENTIAL jobs using MATLAB to run overnight. Because Matlab tends to cause memory fragmentation, I have found that exiting Matlab and restarting for the next job is the best way to conserve memory. At the end of each file I use quit to exit from Matlab and proceed to the next job which opens a new instance. A sample of the batch file is given below:
matlab /r command1('input1') matlab /r command2('input2') matlab /r command3('input3') etc...
On most computers the batch file will execute the first line and open Matlab, then wait for the task to complete and the Matlab window to close before executing the next line and opening the next instance.
However, on some computers the batch file will execute all the items at once, openning many instances of Matlab and swamping the system resources.
I believe the issue is with the DOS prompt and not with Matlab, although I will try to post this on a Matlab forum as well. I was wondering if there is a property of the DOS command window that causes it to behave differently on different system environments, and if there is a way to CHANGE to sequential operation from simultaneous. Has anyone encountered anything like this before?
Thanks for your help.perhaps you can START matlab from your bat-file with the command start /wait
start /wait matlab /r command1('input1') start /wait matlab /r command1('input2') start /wait matlab /r command1('input3')
which will wait until the command is completed (normally all windowsprogams started from bat-files runs in PARALLELL)
|