how do i close plotted graph?

3 visualizaciones (últimos 30 días)
Kritank Kalyan
Kritank Kalyan el 18 de Dic. de 2018
Comentada: Star Strider el 18 de Dic. de 2018
I am trying to close a graph automatically after 5 second of view

Respuesta aceptada

Star Strider
Star Strider el 18 de Dic. de 2018
Try this:
figure
plot(randn(1, 10))
hf = gcf;
pause(5)
close(hf)
  4 comentarios
Guillaume
Guillaume el 18 de Dic. de 2018
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 el 18 de Dic. de 2018
Good point!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by