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.
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 25일
What is this?

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

카테고리

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