closing a specified figure (if exist)

19 visualizaciones (últimos 30 días)
mohammad
mohammad el 6 de Sept. de 2011
Respondida: Zoltan Gal el 13 de Abr. de 2019
does anyone know how to close a specified figure if it exists currently? for example: h=figure
if h exists close(h) end

Respuesta aceptada

Grzegorz Knor
Grzegorz Knor el 6 de Sept. de 2011
h = figure;
if ishandle(h)
close(h)
end
  4 comentarios
Grzegorz Knor
Grzegorz Knor el 6 de Sept. de 2011
close(findobj('type','figure','name','flashing'))
mohammad
mohammad el 6 de Sept. de 2011
thanks a lot

Iniciar sesión para comentar.

Más respuestas (2)

Paulo Silva
Paulo Silva el 6 de Sept. de 2011
close(findall(0,'type','figure','name','flashing'))

Zoltan Gal
Zoltan Gal el 13 de Abr. de 2019
If the index of figure is 5, then
close(findobj('type','figure','number',5))

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by