Problem:

How do I run Matlab in the background on UNIX machines so my job will run after I log out?
 
 

Solution:

This is possible for any job that does not require a Window to be opened (no plots to the screen etc).

nohup matlab -nojvm -nodisplay & myprog.log &

nohup is a generic UNIX program for running any job in the background such that the job will not terminate when the user logs out.
Without nohup, the job might run in the background just fine, but could terminate as soon as the user logs out.

-nojvm tells Matlab not to use Java Virtual Machine, which it uses to spawn windows
-nodisplay tells Matlab not to attempt to open the GUI desktop
>&myprog.log tells the system to write any text output by Matlab and any error messages to the file myprog.log
& tells the operating system to run the job in the background