I am trying to close a graph automatically after 5 second of view

 채택된 답변

Star Strider
Star Strider 2018년 12월 18일

1 개 추천

Try this:
figure
plot(randn(1, 10))
hf = gcf;
pause(5)
close(hf)

댓글 수: 4

madhan ravi
madhan ravi 2018년 12월 18일
+1 nice and easy
Star Strider
Star Strider 2018년 12월 18일
Thank you!
As long as pause is on!
Possibly safer:
hf = figure;
plot(randn(1, 10));
t = timer('StartDelay', 5, 'TimerFcn', @(~, ~) close(hf));
start(t);
Star Strider
Star Strider 2018년 12월 18일
Good point!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2018년 12월 18일

댓글:

2018년 12월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by