필터 지우기
필터 지우기

Simple question with saving a .jpeg

조회 수: 2 (최근 30일)
aurc89
aurc89 2015년 1월 30일
댓글: aurc89 2015년 1월 30일
Hi, I have a very simple question about saving images in Matlab. I need to save a plot as a .jpeg and I do this by executing this code:
hf1=figure;
pcolor(wldf_cut,tau,Iw_cut2),shading interp;
xlabel('Time')
ylabel('Signal');
saveas(gca, fullfile(folder_save, 'map_wl'), 'jpeg');
where folder_save is the directory I choose to save this file. The problem is that this code opens the figure before saving it, while I want it so save the plot without opening the figure in a window. How can I do? Thanks P.S. I do this inside a GUI interface and save the image by pressing a button: if I don't write the line
hf1=figure;
it saves the figure in a wrong way.

채택된 답변

Julia
Julia 2015년 1월 30일
Hi,
I guess if you write s.th. like that
hf1=figure('Visible','Off')
it should solve your problem.
  댓글 수: 1
aurc89
aurc89 2015년 1월 30일
It works! Thank you very much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Display Image에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by