As continuation of my last post, I got a very useful trick of running MATLAB namely to run it as background job.
I am running an optimization problem in MATLAB with hundreds of optimized variables, so it may take around 30 minutes or more to finish. The trick is to make a script as following :
#!/bin/csh -f
unsetenv DISPLAY
nohup matlab < $1 > $2 &
save it as matbg and make it as executable, chmod +x matbg.
$1 is your matlab m file and $2 is an output file. For example, you run it: matbg optim.m result.
It is an excellent script. It means I can leave my simulation running while I am doing other activities 🙂
Similarly, I can use that script for other programs in UNIX server just by changing the program name.