Figures close after running script

12 visualizaciones (últimos 30 días)
João André
João André el 7 de Abr. de 2015
Respondida: Image Analyst el 7 de Abr. de 2015
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?

Respuestas (2)

Geoff Hayes
Geoff Hayes el 7 de Abr. de 2015
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 comentario
João André
João André el 7 de Abr. de 2015
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

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 7 de Abr. de 2015
Try putting this in somewhere near the end of your code:
uiwait(helpdlg('Examine the figures, then click OK to finish.'));

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by