Here is a simple script written for the UNIX C-shell:
#!/bin/csh # Save the DISPLAY setting and clear it. set OLDDISPLAY=$DISPLAY unsetenv DISPLAY # Call MATLAB with the appropriate input and output and make it # immune # to hangups and quits using ''nohup''. Make it run in the # background. nohup matlab < filein > fileout & # Reset the DISPLAY setting setenv DISPLAY $OLDDISPLAYIn this script filein represents the M-file to be run and fileout represents the file to which the standard output is sent. If you want to change the process' priority, you may use the UNIX command nice in the line which invokes MATLAB. For example, if you wish to change MATLAB's priority to 10, change the appropriate line to the following:
nohup nice -10 matlab < filein > fileout &
(c) Copyright 1994 by The MathWorks, Inc.