image Post Your Answer


image

Run MATLAB in background

5 years ago in Matlab By Rajshree Tamang


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 5 years ago

Use GNU screen. You will not lose your session and can easily get back to MATLAB prompt.


By Sriya Rawat Answered 5 years ago

Simply use nohup command on UNIX to prevent MATLAB stop when you log out. nohup matlab -nodisplay -nosplash -r matlab_command > outfile.txt & And don’t forget to include exit; at the end of matlab_command script.


By Vipin Kumar Answered 5 years ago

Hi Rajshree! You can definitely run MATLAB in the background in UNIX operating system. The nohup command and unsetting the display will allow you to run MATLAB in the background successfully even when you log out. Just try the following: 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.


Your Answer


View Related Questions


asked at 05 Dec, 2019 08:10 in Matlab By Rajiv Bhatia


asked at 25 Apr, 2019 07:18 in Matlab By Prithvi Patel




asked at 02 Feb, 2019 08:12 in Matlab By Aama




asked at 04 Aug, 2018 09:34 in Matlab By Nancy Trivedi