Resave a Matlab file with v7.3 option
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Riccardo Micci
am 21 Nov. 2019
Bearbeitet: Ridwan Alam
am 21 Nov. 2019
Hello,
I have few huge files with many substructures inside. I need to partially modify the content. I'm using matfile with option "'Writable',true".
I'm getting a lot of errors because although the total file is less than 2Gb, apparently once uncompressed some array is over 2 GB:
"Warning: The file 'D:\work\capture_tool\dsp\ctt_platform\input\rawdata_toronto55_matrix7x5_70g_50taps.mat' was saved in a format that does not support partial loading. Temporarily loading variable 'Push'
into memory. To use partial loading efficiently, save MAT-files with the -v7.3 flag.
Warning: Variable 'Push' was not saved. For variables larger than 2GB use MAT-file version 7.3 or later. "
If i load and save, it adds another layer in the structure which is the name of the original variable i used to load. Therefore, my program can't access it again:
temp = load('orig.mat');
save('-v7.3','mod.mat','temp')
temp2 = load('mod.mat')
temp2 =
struct with fields:
temp: [1×1 struct]
How can i automatically resave the files with option v7.3 leaving the structure untouched?
Thanks
Riccardo
0 Kommentare
Akzeptierte Antwort
Ridwan Alam
am 21 Nov. 2019
Bearbeitet: Ridwan Alam
am 21 Nov. 2019
The version option goes at the end on save():
save('mod.mat','temp','-v7.3');
While loading,
temp2 = load('mod.mat');
temp2 = temp2.temp;
6 Kommentare
Ridwan Alam
am 21 Nov. 2019
Bearbeitet: Ridwan Alam
am 21 Nov. 2019
Cool!! Glad to help!
Please accept the answer and vote if you liked the conversation!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!