Friday, October 31, 2008

Running MATLAB on UNIX

nohup matlab -nodisplay -nosplash -nodesktop -nojvm -r "matlab_command;exit;" > logfile

The nohup command essentially allows you to run MATLAB from a remote terminal without worrying about connection drops or other hang up issues. However, sometimes it doesn't behave as expected on some UNIX systems. It might be better to use the 'screen' command

A simple tutorial on how to use the screen command is here.

All you need to do is from your terminal type
>screen %This will open up a new screen (Duh!)
>Type your favorite commands

You can now comfortably disconnect your session and reconnect to it any time.

If you want to get out of this screen back to the original terminal press Cntrl + a + d

To reconnect to a screen session simply type
>screen -r

This will either bring up the screen session (if you have just one session going) or give you a list of screen ids.

To connect to a particular screen session
> screen -r

No comments: