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 (최근 30일)
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.

답변 (1개)

Cris LaPierre
Cris LaPierre 2019년 4월 20일
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.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by