how do i close plotted graph?
9 ビュー (過去 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!