Is there a way of creating a code so every time you save a figure as .mat it automatically also saves it as .bmp?

1 view (last 30 days)
I am running various code, and I dont want to save the figure every time (hence I don't want to incorporate it into my functions or codes)
I was just wondering if there was a way of setting matlab up so that every time i save a file as .mat manually in the figure window - that it also saves the figure simultaniouly in another format (fx .bmp)
currently I have to go in manually and save the file twice which is time consuming.

Answers (1)

Cris LaPierre
Cris LaPierre on 20 Apr 2019
There is code you can add to your script/function so that once a figure has been created, it will save it.
This is done with the print command. Use the formattype argument to specify the file format to create. There are a couple of bmp options shown in the table here.
See this example for saving a barplot as a png. Additional examples follow it.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!