Figures close after running script

I'm running matlab through the command line interface, and when I call it to run a specific script (e.g. matlab -nosplash -nodesktop <test.m), all the figures and plots I issue in the script test.m are closed (so I only glimpse them for a few seconds). Is there a way to keep the figures around?

답변 (2개)

Geoff Hayes
Geoff Hayes 2015년 4월 7일

0 개 추천

João - put a pause call at the end of your code to temporarily halt the execution before the script ends. See the link for details on how to use this function.

댓글 수: 1

This does not work. pause(n) does halt the execution for n seconds, but a simple pause or pause on does not halt it indefinitely. I'm also getting the following warning:
Warning: Objects of graph2d.lineseries class exist - not clearing this class or any of its superclasses

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

Image Analyst
Image Analyst 2015년 4월 7일

0 개 추천

Try putting this in somewhere near the end of your code:
uiwait(helpdlg('Examine the figures, then click OK to finish.'));

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2015년 4월 7일

답변:

2015년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by