MATLAB: Warning to save when saving workspace.

MATLABsavesavefigwarning

For this code:
savename = sprintf('%s_%s.mat',fname1,fname2);
save(savename);
It produces a warning: "Warning: Figure is saved in C:\Data\R1\R32.mat. Saving graphics handle variables can cause the creation of very large files. To save graphics figures, use savefig."
The save actually worked and saved the workspace correctly as .mat. Changed to "save savename" it had the same warning.
Why's that? It's not a fig to save.

Best Answer

When you do not tell save() which variables to save then it saves everything in your current workspace, including any graphics objects whose handles are in the current workspace. It is recommended that you tell save which variables you wish to save.