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!