필터 지우기
필터 지우기

Save Figure in workspace

조회 수: 30 (최근 30일)
Mauro De Francesco
Mauro De Francesco 2019년 7월 30일
댓글: Wu Yu-Wei 2021년 4월 19일
I am trying to save a figure I have to the workspace. The current workflow involves using the print function and then reopen it using imread. Is there a way to jump over the print + imread functions and just save the image to a variable in the workspace? I need to save it with a certain resolution (1024x1024 pixels)
print('MoonImage','-dpng','-r300')

답변 (1개)

Roshni Garnayak
Roshni Garnayak 2019년 8월 2일
You can use the following lines of code to save the figure to workspace and set the desired resolution:
f= frame2im(getframe(gcf));
I=imresize(f,[1024,1024]);
For more information on the ‘gcf’ function, refer the following link:
  댓글 수: 1
Wu Yu-Wei
Wu Yu-Wei 2021년 4월 19일
How do you view or open this saved figure?

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

카테고리

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