closing a specified figure (if exist)

17 vues (au cours des 30 derniers jours)
mohammad
mohammad le 6 Sep 2011
does anyone know how to close a specified figure if it exists currently? for example: h=figure
if h exists close(h) end

Réponse acceptée

Grzegorz Knor
Grzegorz Knor le 6 Sep 2011
h = figure;
if ishandle(h)
close(h)
end
  4 commentaires
Grzegorz Knor
Grzegorz Knor le 6 Sep 2011
close(findobj('type','figure','name','flashing'))
mohammad
mohammad le 6 Sep 2011
thanks a lot

Connectez-vous pour commenter.

Plus de réponses (2)

Paulo Silva
Paulo Silva le 6 Sep 2011
close(findall(0,'type','figure','name','flashing'))
  1 commentaire
mohammad
mohammad le 6 Sep 2011
thanks a lot

Connectez-vous pour commenter.


Zoltan Gal
Zoltan Gal le 13 Avr 2019
If the index of figure is 5, then
close(findobj('type','figure','number',5))

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by