closing a specified figure (if exist)

26 visualizzazioni (ultimi 30 giorni)
mohammad
mohammad il 6 Set 2011
Risposto: Zoltan Gal il 13 Apr 2019
does anyone know how to close a specified figure if it exists currently? for example: h=figure
if h exists close(h) end

Risposta accettata

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

Accedi per commentare.

Più risposte (2)

Paulo Silva
Paulo Silva il 6 Set 2011
close(findall(0,'type','figure','name','flashing'))

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

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by