Save figure or Simulink block diagram using specified format
Use File > Save As on the figure window menu to access the Save As dialog, in which you can select a graphics format. For details, see Exporting in a Specific Graphics Format in the MATLAB® Graphics documentation. Sizes of files written to image formats by this GUI and by saveas can differ due to disparate resolution settings.
saveas(h,'filename.ext') saves the figure or Simulink® block diagram with the handle h to the file filename.ext. The format of the file is determined by the extension, ext. Allowable values for ext are listed in this table.
You can pass the handle of any graphics object to saveas, which then saves the parent figure to the object you specified should h not be a figure handle. This means that saveas cannot save a subplot without also saving all subplots in its parent figure.
Adobe® Illustrator `88
Support for this format will be removed in a future release.
EPS Level 1
MATLAB figure (invalid for Simulink block diagrams)
JPEG image (invalid for Simulink block diagrams)
MATLAB file (invalid for Simulink block diagrams)
Portable Document Format
Portable Network Graphics
TIFF image, compressed
saveas(h,'filename','format') saves the figure or Simulink block diagram with the handle h to the file called filename using the specified format. The filename can have an extension, but the extension is not used to define the file format. If no extension is specified, the standard extension corresponding to the specified format is automatically appended to the filename.
Allowable values for format are the extensions in the table above and the device drivers and graphic formats supported by print. The drivers and graphic formats supported by print include additional file formats not listed in the table above. When using a print device type to specify format for saveas, do not prefix it with -d.
Save the current figure that you annotated using the Plot Editor to a file named pred_prey using the MATLAB fig format. This allows you to open the file pred_prey.fig at a later time and continue editing it with the Plot Editor.
Save the current figure, using a Portable Document format, to the file logo. Use the pdf extension from the above table to specify the format. The file created is logo.pdf.
The file created is logo.pdf. MATLAB automatically appends the pdf extension because no extension was specified.
Save the current figure to the file star.eps using the Level 2 Color PostScript format. If you use doc print or help print, you can see from the table for print device types that the device type for this format is -dpsc2. The file created is star.eps.
In another example, save the current Simulink block diagram to the file trans.tiff using the TIFF format with no compression. From the table for print device types, you can see that the device type for this format is -dtiffn. The file created is trans.tiff.
Save a Simulink diagram from command line. The file is saved as counters.bmp
Using get_param, get the handle of the model and save using the saveas command. The file can be saved in any desired standard image formats.
Whenever you specify a format for saving a figure with the Save As menu item , that file format is used again the next time you save that figure or a new figure. If you do not want to save in the previously-used format, use Save As and be sure to set the Save as type drop-down menu to the kind of file you want to write. However, saving a figure with the saveas function and a format does not change the Save as type setting in the GUI.
If you want to control the size or resolution of figures saved in image (bit-mapped) formats, such as BMP or JPG, use the print command and specify dots-per-inch resolution with the –r switch.
When printing or exporting to a vector format (such as ps, eps, pdf, svg, or emf), specify the renderer as painters. Using the default renderer (opengl), results in a bitmap contained in a vector format. Set the renderer with the print command, from the Export Setup dialog, or by setting the figure Renderer property
The saveas function and the Save As dialog accessed from the File menu do not produce identical results.