Hi everybody i have a for in my matlab script which display a figure and i saved the figure. But the problem is :
For i = 1 i have this : saveas(gcf,'picture1.jpg') For i = 2 i would like to have this saveas(gcf,'picture2.jpg')
Is it possible to do this with for ?
I tried to do this : saveas(gcf,'picturei.jpg') but it does not work because i is seen by matlab as a string...
Thanks for your help !

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 6일
편집: Azzi Abdelmalek 2016년 5월 6일

0 개 추천

for k=1:3
filename=sprintf('picture%d.jpg',k)
saveas(gcf,filename)
end

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2016년 5월 6일

편집:

2016년 5월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by