How can I save the output figure into an image file?

3 次查看(过去 30 天)
recon_img = senserecon(aliased_img, sen_map,reduc, fi_matrix);
figure;imshow(abs(recon_img),[0 0.000005]);title('sense recon');
After this line of code the output image shows. Now, I want to export this output figure into another image file.

采纳的回答

yanqi liu
yanqi liu 2022-3-15
recon_img = senserecon(aliased_img, sen_map,reduc, fi_matrix);
figure;imshow(abs(recon_img),[0 0.000005]);title('sense recon');
print(gcf,'-dpng','-r200','sense_recon')
  1 个评论
Gulfam Saju
Gulfam Saju 2022-3-15
The image saves with the title. Is there any way to remove the title? and there are several iterations in the program. So, there are multiple output images? How can I save all using a loop?

请先登录,再进行评论。

更多回答(1 个)

Scott MacKenzie
Scott MacKenzie 2022-3-14
编辑:Scott MacKenzie 2022-3-14
A easy way is to use exportgraphics, introduced in R2020a:
f = figure;
imshow(...);
exportgraphics(f, 'filename.jpg'); % or .png or whatever format you want (see documentation)

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by