Use the index in a FOR loop for a string
显示 更早的评论
How do I make 50 plots (in separate figures) using the following format:
for i = 1:50
figure('name','Hurricane "i"')
scatter(x,y,10,z"i");
title('Hurricane "i"');
end
e.g. I want graphs like scatter(x,y,10,z36) with the title of "Hurricane 36". Thanks for your help in advance.
采纳的回答
更多回答(1 个)
John Osborne
2017-4-10
编辑:John Osborne
2017-4-10
Try
figure(i)
%plotting commands
title(['Hurricane ' num2str(i)])
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!