productivity
productivity

Reputation: 1

Exporting a figure

I came across this program for exporting a figure. I just want to ask, what should I pass to the program if I want to export a figure of mine to some image (i.e; .jpg), as I couldn't figure out what to pass as a parameter.

Thanks.

Upvotes: 0

Views: 41

Answers (2)

Leporello
Leporello

Reputation: 658

patrik's suggestion probably refers to this ME file. (Which is great, by the way)

A native MATLAB solution would be

saveas(<handle of the figure>,<file path with .jpg at the end>)

This is what I have used for a long time and it works (e.g., saveas(h,'/figures/automatic/myfig.jpg')); but it is very possible that print or something else is better suited for whatever reason.

Upvotes: 0

such
such

Reputation: 603

The built-in command print is used to export a figure to an image. Like so:

 plot(rand(4))
 print('-djpeg', 'myplot.jpg')

Upvotes: 1

Related Questions