필터 지우기
필터 지우기

How to use a figure as 'if condition'?!

조회 수: 4 (최근 30일)
sajjad hosseinifard
sajjad hosseinifard 2018년 7월 16일
댓글: Fangjun Jiang 2018년 7월 16일
I's using an m file to plot some data, online. I want to make an 'if condition', when I close the figure that is plotting my data manually!! Shortly, How could I Initialize a loop by closing a specific figure?!(as I close the figure the loop being started)

채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 7월 16일
Would this work?
f1=figure;
...
status=close(f1);
You can then check the "status" using "if"
  댓글 수: 2
sajjad hosseinifard
sajjad hosseinifard 2018년 7월 16일
thank you because of your answer..yes it works..but I want to start the loop when I close the figure by clicking on the close button!!
Fangjun Jiang
Fangjun Jiang 2018년 7월 16일
a simple example
f1=figure;
set(f1,'DeleteFcn','for k=1:10; disp(k);end')
then close the figure manually

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by