I have 4 matlab scripts, each saving a figure at the end as a png file in a folder.
I have a different script which I want to use to export all 4 png files at once using export_fig.
Problem: how do I "load" the saved figures into the script so that I can convert them using export_fig?
code right now:
export_fig fig1.png
export_fig fig2.png
export_fig fig3.png
export_fig fig4.png
ERROR:
Error using export_fig
No figure found
this export script is in the same folder as the 4 scripts which generated the figures and the saved figures themselves

 採用された回答

Arthur Roué
Arthur Roué 2020 年 7 月 24 日

2 投票

If you saved your figures in a FIG-File, then
fig_handle = openfig(filename)
will open it.
Here a link to openfig documentation.

4 件のコメント

gummiyummi
gummiyummi 2020 年 7 月 24 日
I have the figure saved as a .png file, sadly can't open it with openfig
Arthur Roué
Arthur Roué 2020 年 7 月 24 日
編集済み: Arthur Roué 2020 年 7 月 24 日
Oh yes, then maybe try
img = imread('fig1.png');
and then you can convert it with
imwrite(img, 'fig1.jpg');
Or plot it
image(img)
to use function export_fig
gummiyummi
gummiyummi 2020 年 7 月 24 日
thanks!
Arthur Roué
Arthur Roué 2020 年 7 月 24 日
You're welcome ! Can you accept the answer ?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File 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