Unable to save variables and figures of large arrays
Mostra commenti meno recenti
i keep getting this error:
Warning: Variable 'hgS_070000' cannot be saved to a MAT-file whose version is older than 7.3.
To save this variable, use the -v7.3 switch.
Skipping...
> In matlab.graphics.internal.figfile.FigFile/write (line 32)
In savefig (line 84)
Error using save
Error closing file D:\Dropbox (Personal)\C\Resaults\2018_11_13_21_45_10.926(Temperature map).fig.
Error in matlab.graphics.internal.figfile.FigFile/write (line 32)
save(obj.Path, obj.MatVersion, '-struct', 'SaveVars');
Error in savefig (line 84)
FF.write();
i use this command
savefig([time_stamp,'(LASER)','.fig'])
saveas(gcf,[time_stamp,'(LASER)','.png'])
the arrays are really big 15000x30000
what is the meaning of this error?
how to avoid it?
Risposta accettata
Più risposte (1)
Philipp Lauff
il 30 Giu 2024
0 voti
Hi, I still encounter this problems (5 yeras later...) and I just took a look into the code. To fix it, follow these steps.
Copy from
"C:\Program Files\MATLAB\R2023b\toolbox\matlab\graphics\objectsystem\"
the file savefig.m and folder \private\ to your current working directory.
In the copied savefig.m add "FF.MatVersion = '-v7.3';" before the "FF.write();" (currently line 83). Now Matlab prefers your version of the savefig function and will use your code with the MAT-File version 7.3.
This is not the prettiest workaround as you have to copy the adjusted file and the folder to all your working directories (if you have mutliple), but changing it in the Matlab folder won't do the trick. I suppose, these files are precompiled and therefore changes are not executed.
Categorie
Scopri di più su Printing and Saving in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
