closing a specified figure (if exist)

19 Ansichten (letzte 30 Tage)
mohammad
mohammad am 6 Sep. 2011
Beantwortet: Zoltan Gal am 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Paulo Silva
Paulo Silva am 6 Sep. 2011
close(findall(0,'type','figure','name','flashing'))

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

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by