how do i close plotted graph?

조회 수: 3 (최근 30일)
Kritank Kalyan
Kritank Kalyan 2018년 12월 18일
댓글: Star Strider 2018년 12월 18일
I am trying to close a graph automatically after 5 second of view

채택된 답변

Star Strider
Star Strider 2018년 12월 18일
Try this:
figure
plot(randn(1, 10))
hf = gcf;
pause(5)
close(hf)
  댓글 수: 4
Guillaume
Guillaume 2018년 12월 18일
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개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by