필터 지우기
필터 지우기

save figure in backround job

조회 수: 1 (최근 30일)
Franziska
Franziska 2012년 4월 3일
Hi,
I am running a matlab job on an external computer. Figure display is not possible. However, I would like to save figures while the job is running between. I tried the following:
(extract from the code)
for ii = 1:1:100
% ...working with Frame ...
figure('visible','off')
imshow(Frame);
print(gcf,'-dpng', ['frame' num2str(ii),'.png']);
close(figure)
end
but it doesn't work. Does anyone have an idea how to realize that? I really prefer to save the images and not to keep the data sets.
Thanks a lot in advance.
Franziska
  댓글 수: 4
Sean de Wolski
Sean de Wolski 2012년 4월 3일
Why not just IMWRITE?
Franziska
Franziska 2012년 4월 4일
Thanks for your help!
I deleted the lines creating the figure with imshow and can use imwrite or imsave right a way.

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

채택된 답변

Thomas
Thomas 2012년 4월 3일
Your code should work.. If not try..
doc imsave
  댓글 수: 2
Franziska
Franziska 2012년 4월 3일
Thanks for your answer. The problem is not to save the figure, it's the imshow command. I receive the following error message:
"{Error using imshow (line 190)
IMSHOW unable to display image.}
The code runs fine on my PC without showing the figure.
Cheers,
Franziksa
Franziska
Franziska 2012년 4월 4일
It work's. Sorry for confusion.
If I do not create the figure but save the image directly, it's fine.
Thank's for your help.

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

추가 답변 (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