Save figures with saveas function

조회 수: 2 (최근 30일)
Qian
Qian 2012년 12월 11일
When I have a m.file with plot function codes, and at last there is this line of: print -djpeg100 aaaa
I'm not sure this is doing, when I run that file, isn't it going to output the plot I need? And I'm just wondering is there anyway to save the plot instead of saving it and naming it manually. I tried with saveas function, but it gives the non-colored result. If my ploting code names as plot_a,would I be able to name the plot the same name without type plot_a as the file name? Thanx!

답변 (1개)

Arthur
Arthur 2012년 12월 11일
You mean you want to set the filename yourself? You can use uiputfile for that.
[filename dirname] = uiputfile; %set file name and location
fullname = fullfile(dirname,filename); %make full file name
print('djpg100',fullname) %save plot as fullname

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by