close figure and stop loop

1 visualización (últimos 30 días)
ali atay
ali atay el 25 de Abr. de 2016
Editada: ali atay el 25 de Abr. de 2016
hi, first of all i am sorry for my english.
my program:
f=figure(1);
while 1;
bla bla ...
end
i try to close figure 1 but re-open itself.
and i try this in while:
h = findobj('type','figure');
n = length(h);
if(n==0)
break;
end
but not work it!
please help me.

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 25 de Abr. de 2016
break will not close a figure, use
close(1)
  2 comentarios
ali atay
ali atay el 25 de Abr. de 2016
Editada: ali atay el 25 de Abr. de 2016
click to close button on figure 1 => n=0. //no active figure already
if n==0 => break. //dont work, loop is active and re-open figure1.
Azzi Abdelmalek
Azzi Abdelmalek el 25 de Abr. de 2016
What is this?

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks 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