Problem running matlab script to background

조회 수: 3 (최근 30일)
Aristotelis
Aristotelis 2013년 3월 12일
댓글: Alessandro 2013년 10월 11일
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!
  댓글 수: 1
Alessandro
Alessandro 2013년 10월 11일
Dear Aristotelis, look at this guide, I had the same issue and now everything works fine ;)
I hope it will be helpful :)
Ale

댓글을 달려면 로그인하십시오.

채택된 답변

Konrad Malkowski
Konrad Malkowski 2013년 3월 12일
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?
  댓글 수: 1
Aristotelis
Aristotelis 2013년 3월 12일
Thank you for your answer! Using -painters option solves the problem as zbuffer doesn't run in terminal mode. I already have included exit as last command. Unfortunately didn't make any difference as the code stopped before reaching the end.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 12일

Are you using OS-X or Linux? If so,

nohup matlab -nosplash -nodisplay -nodesktop -r 'try; ScriptName; catch; end; quit' > output.log &

where ScriptName does not have the .m

  댓글 수: 1
Aristotelis
Aristotelis 2013년 3월 12일
Thanks! You really saved me a lot of trouble! Works just fine.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by