Post Your Answer
7 years ago in Matlab By Rajshree Tamang
Run MATLAB in background
Hello everyone, I use UNIX operating system and I have successfully installed MATLAB in my system. I want to know if I can run MATLAB in the background in UNIX system. If yes how do I do it? Can someone guide me on this? It would be of great help.
All Answers (3 Answers In All)
By Tarushi Yadav Answered 7 years ago
Reply to Tarushi Yadav
By Sriya Rawat Answered 7 years ago
nohup matlab -nodisplay -nosplash -r matlab_command > outfile.txt &
And don’t forget to include exit; at the end of matlab_command script.
Reply to Sriya Rawat
By Vipin Kumar Answered 7 years ago
set OLDDISPLAY=$DISPLAY
unsetenv DISPLAY
nohup matlab 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 $2 &
setenv DISPLAY $OLDDISPLAY
To run this file, issue the command as:
matbat infile outfile
It did work in my system.
Reply to Vipin Kumar
Related Questions