how can I save a file as .png format?
조회 수: 6 (최근 30일)
이전 댓글 표시
I have a folder with 20 files in .fig format, how can I save these files in .png format? (they have different names and I want the programm to save the files after some changes.
thanks
댓글 수: 0
답변 (2개)
Azzi Abdelmalek
2014년 1월 14일
f=dir('*.fig') % or adsd your folder
for k=1:numel(f)
name=f(k).name;
h=hgload(name);
new_name=strrep(name,'.fig','.png');
saveas(h,new_name);
close
end
댓글 수: 0
David Sanchez
2014년 1월 14일
h=plot(rand(10,1),rand(10,1))
saveas(h,'my_fig','fig'); % your figure is saves as *.fig
% code to print a saved *.fig into *.png
figure_handle = openfig('my_fig.fig');
print(figure_handle,'-dpng','my_fig.png')
참고 항목
카테고리
Help Center 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!