close figure and stop loop

2 次查看(过去 30 天)
ali atay
ali atay 2016-4-25
编辑: ali atay 2016-4-25
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.

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-4-25
break will not close a figure, use
close(1)
  2 个评论
ali atay
ali atay 2016-4-25
编辑:ali atay 2016-4-25
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by