how to define a path in saveas command
显示 更早的评论
I am using saveas command in a ''for loop'' to save 20 plots in .png format. How can I add the i counter of for loop in saveas command. Many thanks
pathdatasave = 'E:\matlab';
saveas(gcf,[pathdatasave '%03d' '.png' ]);
采纳的回答
更多回答(1 个)
Tommy
2020-6-18
Possibly like this?
pathdatasave = 'E:\matlab';
saveas(gcf,sprintf('%s%03d.png', pathdatasave, i));
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!