Keep in mind that the figures might not be.
Save figure as mat matlab.
The documentation for the save command says that you should delete figures if you don t want to bog down the mat file.
Why do you need a mat file.
Learn more about save figure as mat handle2struct.
Fig save the figure as a matlab figure file with the fig extension.
Save figure as mat to a different folder.
This format is not valid for simulink block diagrams.
Today i am writing this tutorial for creating and saving m file in matlab.
To open the figure run the matlab file.
M or mfig save the figure as a matlab figure file and additionally create a matlab file that opens the figure.
Delete any figures before using save.
This option is not valid for simulink block diagrams.
If you are writing the program for solving technical computing or running simulink model you need to save the program as m file in matlab.
Savefig saves the full matlab figure.
I save to a mat file periodically and i re use my figure after issuing clf i would prefer not to have to delete it just to save a mat file then open a new figure.
I get the first figure in my question above with the corresponding colorbar.
M or mfig save the figure as a matlab figure file and additionally create a matlab file that opens the figure.
To open figures saved with the fig extension use the openfig function.
If you use save to save a figure then the function displays a warning message.
While learning matlab you should know how to create mat file in matlab.
I found some solution where one need to specify and save manualy all the figures but i am looking for something fast and automatic.
Is there a way to do this.
To open figures saved with the fig extension use the openfig function.
Use the savefig function instead.
Using your answer above i try to save the colormap to a mat file so that whenever i run this code again i can load the colorbar and apply it to other figures.
Please how to save all figures that have been generated by a code or different codes so al opened figures in one pdf file.
To open the figure run the matlab file.
Avoid saving figures with the save function.
This format is not valid for simulink block diagrams.