save plot as png with 300 dpi resolution
print('figure01', '-dpng', '-r300')
save plot as pdf
print('figure02', '-dpdf')
https://www.mathworks.com/help/matlab/ref/print.html