In UNIX: The nohup command and unsetting the display will allow you to run MATLAB in the background successfully even when you logout.
Try the following:
set OLDDISPLAY=$DISPLAY
unsetenv DISPLAY
nohup matlab < filein > fileout &
setenv DISPLAY $OLDDISPLAY
where filein is the M-file you want to run and fileout is the file you want the output to go to. To set this up as a C shell script, write a file called matbat as:
#!/bin/csh set OLDDISPLAY=$DISPLAY
unsetenv DISPLAY nohup matlab < $1 > $2 &
setenv DISPLAY $OLDDISPLAY
To run this file, issue the command as:
matbat infile outfile
In MS Windows: You need to set the ratio for applications running in the foreground as opposed to running in the background. This ratio will determine how well you can run MATLAB in the background. To set this ratio, go into 386 Enhanced in your Windows Control Panel. You can change your ratio here.