Can 'export Figure' be written in command without clicking figure settings by hands ?

1 view (last 30 days)
wenhao yang
wenhao yang on 4 Mar 2021
Answered: wenhao yang on 4 Mar 2021
I'm saving figures by using 'File -> export setup'. Here I can set the figure 'height and width', and then 'dpi'.
I have lots of figures to save.
Is there any command can do the process to set the figure 'height and width', and then 'dpi' and save the figure ?

Accepted Answer

wenhao yang
wenhao yang on 4 Mar 2021
I found it.
set(gcf,'unit','centimeters','position',[10 10 25 20]);
print(gcf,'-djpeg','-r600',PATH);
25: height,cm
20: width.cm
-r600: 600 dpi
Thanks for my work. LOL~!

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by