Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Support Forums
 Unix Support
 Headless, batched MATLAB

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
charles.michelich Posted - May 21 2003 : 10:18:53 AM
Hello All,

If you want to run MATLAB in a "batch mode" you can use the following command:
matlab -nodisplay < test.m >> test.log &
This command will start MATLAB without a display, run the script test.m, and then exit MATLAB. Anything that would have appeared in the MATLAB command window will be appended to test.log. The & causes the program to run in the background so that you can do other things from that shell.

Note that there is no way to interact with MATLAB when running in batch mode other that stopping the job using the kill command. If an error occurs while running the script, MATLAB will exit. Look in test.log (or whatever file to directed the output to) for the error messages.

If you attempt to exit the shell before the script is finished, you will receive a warning that "There are stopped jobs" and the shell will continue to run. If you attempt to exit twice in a row, the MATLAB script (and any other stopped jobs) will be terminated without finishing.

To see a list of the programs that you are running from the current shell, type
ps
To see a list of all the programs that you are running, type
ps -u $USER
To run a job that will continue to run after you log out, add nohup to the beginning of the command. For example:
nohup matlab -nodisplay < test.m >> out.txt &
Enjoy,
Chuck

BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.28 seconds. Snitz Forums 2000