how do i close plotted graph?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to close a graph automatically after 5 second of view
댓글 수: 0
채택된 답변
Star Strider
2018년 12월 18일
Try this:
figure
plot(randn(1, 10))
hf = gcf;
pause(5)
close(hf)
댓글 수: 4
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);
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!