Matlab/Octave scripts


(Difference between revisions)
Jump to: navigation, search
Line 67: Line 67:
  ps2pdf diagram1.eps
  ps2pdf diagram1.eps
====Export in svg====
SVG stands for [ Scalable Vector Graphics]. To export in this format with matlab, download the package [ plot2svg]

Revision as of 16:19, 22 March 2012

To download the scripts, you need an account on modb. On a Linux/Unix computer, the scripts can be downloaded with the svn command:

svn checkout svn+ssh:// Scripts

some instructions from a Windows user?

The scripts are organized in subdirectories. Currently, it only contains:

Input-output functions for the GHER fileformat (in big-endian)

You can include the directory Scripts (with all subdirectories) in your search path by adding the following to your startup.m (matlab) or ~/.octaverc (octave) file:


More information about SVN:


Exporting figures

Each of the following sections presents a different way to export or save a graphic created using matlab.

Save as matlab .fig file

A matlab figure can be saved as a .fig file (matlab format) using the command saveas.


After that, the figure can be loaded again using


Export in usual image formats

The figure can also be exported in various image formats. This is done using the command print.



  • -dpng specifies the output format.
  • -r300 specifies the resolution in dpi.
  • diagram1 is the name of the newly created file. Note that the extension is automatically appended.

Export in eps

When you want to export figures as Encapsuled PostScript (eps), instead of using


it is recommended to employ the set of functions exportfig.m, previewfig.m, applytofig.m and restorefig.m, available at


The results will have a better quality than the one obtained with print.

Export in pdf

When you want to export figures as pdf, instead of using


it is recommended to export the figure in eps, as explained in the previous paragraph, and then convert it in pdf, using for instance:

ps2pdf diagram1.eps

Export in svg

SVG stands for Scalable Vector Graphics. To export in this format with matlab, download the package plot2svg

Personal tools