How to output multiple figures?
显示 更早的评论
As the code below, I generate a picture in each loop. How do I use saveas() to store every image in a given folder with the name 'image_i.png'(where i is a variable)? So I get ten images named image_1 to image_10.
for i = 1:10
f = figure();
hold on;
plot(A);
plot(B);
text('');
saveas(f,'c:\image_i.png')
end
采纳的回答
更多回答(1 个)
per isakson
2014-2-27
编辑:per isakson
2014-2-27
Warning: not tested
Replace
saveas(f,'c:\image_i.png')
by
saveas( f, sprintf( 'c:\\image_%i.png', i ) )
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!