number of figure windows that are currently open?
조회 수: 16 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Bora Eryilmaz
2022년 12월 8일
편집: Bora Eryilmaz
2022년 12월 8일
f1 = figure;
f2 = figure;
F = findobj('Type', 'figure')
n = numel(F)
댓글 수: 0
추가 답변 (1개)
Daniel Vieira
2022년 12월 8일
I do something like this:
for k=1:K
% my code here
figure;
% 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
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!