how to save the figure?

조회 수: 11 (최근 30일)
win
win 2013년 5월 10일
i have some functions then i have
if true
figure(k)
end
each iteration i got one figure. now i want to save the every figure in a new directory. please help me

채택된 답변

Lisa Wu
Lisa Wu 2013년 5월 10일
num_of_fig = 1;
fichier=fullfile('directory','filename') ;
if true
figure(k);
name = strcat('figure',num2str(num_of_fig ));
% save figure name as figure1,figure2,figure3
saveas(gcf,strcat(name,'jpg'));
num_of_fig = num_of_fig +1;
end
  댓글 수: 1
win
win 2013년 5월 11일
thanks littele bit helped

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 10일
fichier=fullfile('directory','filename')
saveas(gcf,'fichier.jpg')
  댓글 수: 2
win
win 2013년 5월 10일
it saves only one figure. for eg., in the final output i got 10 output images via for loop. i got a figure in every iteration. and also i need to save all those 10 images. please help
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 10일
for k=1:10
fichier=fullfile('directory',sprintf('filename%d',k))
saveas(gcf,'fichier.jpg')

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2013년 5월 11일
The usual answer is to refer to the FAQ for several code examples: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by