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!