Change name of a graph inside loop automatically.
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a loop from one to ten. for each loop I got graph. My question is can I change the name of graph automatically?
For example. first graph will have name (Result for experiment number 1)
second graph will have name (Result for experiment number 2),
and so on for all ten graphs
Regards
0 个评论
回答(1 个)
Stalin Samuel
2015-11-24
for i=1:10
figure(i)
title(sprintf('Result for experiment number %d',i))
end
1 个评论
Stephen23
2015-11-24
Note that it is recommended to avoid the variable names i and j, as these are both names of the inbuilt imaginary unit.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!