MATLAB Saving Plots in Matlab - A Beginner's Guide

  • Thread starter Thread starter MaxManus
  • Start date Start date
  • Tags Tags
    Matlab Plot
AI Thread Summary
To save multiple plots in different files using MATLAB, the user encountered an error with the print command due to incorrect syntax. The correct approach involves properly formatting the filename string. It is recommended to resize the plots to standard sizes like Letter or A4 before exporting to ensure quality, as this can prevent pixelation. Additionally, MATLAB documentation provides guidance on exporting plots in various formats, which can be helpful for new users.
MaxManus
Messages
268
Reaction score
1
Hey, I am making some plots in a loop and I want to save the different plots in different files.

I am new to Matlab so I don't know what to do, I tried the command

print('-dpdf','plot n = %s'n)

,but that was an 'Unexpected MATLAB expression.'
 
Physics news on Phys.org
Take a look through the pertinent MATLAB documentation page:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/print.html

(Exporting to various formats is about half-way through).

Note that you should probably resize the plot (to, say, Letter or A4 size) prior to exporting, otherwise things may look rather pixellated (though there is an option for vector output).
 
Thanks.
 

Similar threads

Replies
1
Views
2K
Replies
32
Views
4K
Replies
1
Views
2K
Replies
10
Views
3K
Replies
1
Views
2K
Replies
4
Views
2K
Back
Top