MATLAB: How to export figure to a file

exportfigurefilepicturewindows

Hi,
I am running a script and at the end I am outputing a figure with a few graphs on it. Is there any way, in the script, I can get it to automatically save it as a picture (jpeg or whatever) to a specific file on my computer?
Thanks

Best Answer

h=plot(x,y)
saveas(h,'FileName.jpg')
Related Question