Search code examples
matlabmatlab-figureeps

Write a figure to a file automatically in MATLAB


Does anyone know if it's possible to automatically write a figure out to a .eps file in MATLAB?

I'm running a script that produces a large number of graphs, and it'd be nice if I didn't have to manually save each one!


Solution

  • print function does that:

    Print figure or save to specific file format...

    print(filename,formattype) saves the current figure to a file using the specified file format, such as print('BarPlot','-dpng'). If the file name does not include an extension, then print appends the appropriate one.

    print(filename,formattype,formatoptions) specifies additional options that are available for some formats.

    print prints the current figure to the default printer...