number of figure windows that are currently open?
12 views (last 30 days)
Show older comments
Doug Ivers on 8 Dec 2022
Answered: Daniel Vieira on 8 Dec 2022
In a script can I get the number of figure windows that are currently open?
Why?: as I re-run the script over and over to generate another figure, I'd like to position each new figure incrementally to the right
Bora Eryilmaz on 8 Dec 2022
Edited: Bora Eryilmaz on 8 Dec 2022
f1 = figure;
f2 = figure;
F = findobj('Type', 'figure')
n = numel(F)
More Answers (1)
Daniel Vieira on 8 Dec 2022
I do something like this:
% my code here
% my plot here
fig=gcf; % get figure handle
fig.Position=[50+10*k 50+10*k fig.Position(3:4)]; % puts 1st image in pixel [50 50], second in [60 60], etc
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!