Clear Filters
Clear Filters

Figure count

125 views (last 30 days)
Paul Kelly
Paul Kelly on 21 Dec 2011
Edited: Steven Lord on 10 Mar 2023
Is there a way of counting the number of figure windows currently open? I am trying to clear a set of figure windows without closing them.
  1 Comment
Mary
Mary on 10 Mar 2023
Edited: Steven Lord on 10 Mar 2023
Yes, you can use the 'numel' and 'findall' functions in MATLAB [SL: removed URL unrelated to question] to count the number of open figure windows.

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 21 Dec 2011
h = findobj('type','figure');
n = length(h);
And you can set the properties of all three at once using their handles - stored in h.
  3 Comments
Chuck Hayden
Chuck Hayden on 16 Mar 2022
thanks !
the cyclist
the cyclist on 3 May 2022
This was handy for me, too, 11 years after it was answered. :-)

Sign in to comment.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!