MATLAB: Problem running matlab script to background

backgroundmap plotsMATLABnodisplay

Hello, I made a script to create some map plots using functions like contourfm and quiverm. I run this script on a server and putting it to background like this:
matlab -nosplash -nodisplay -nodesktop < (name.of.script.m) > output.log &
Then I can successfuly logout the machine and the job continues until an error occurs stating: "Segmentation fault (core dumped)" leading to no results.
If I try without -nodisplay switch, no Segmentation fault appears, results are generated but I cann't logout without killing the job at the same time…
Any ideas would be helpful! Thank you in advance!

Best Answer

What type of image are you trying to save?
Saving to jpg, png, tiff or eps/ps is usually safer than other file formats when no desktop is present.
You could try using a different rendering method. I would recommend painters or zbuffer.
As for the second part of the question. What happens when you add "exit" as the last command in the script?