How do I name figures in for loops.
33 次查看(过去 30 天)
显示 更早的评论
My for loop is i=1:10 in which 10 plots wre produced at 10 different locations. I would like to name the figures as 'location i' where i is 1,2,3,...10 but without having to name each figure individually. Is there a function to do this?
0 个评论
回答(1 个)
Walter Roberson
2020-11-28
for i = 1 : 2
fig(i) = figure('name', sprintf('location %d', i));
end
fig(1).Name
fig(2).Name
另请参阅
类别
在 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!