matfile and half inefficient storage

13 visualizaciones (últimos 30 días)
Mika
Mika el 24 de Jul. de 2021
Comentada: S Priyadharshini el 30 de Ag. de 2021
Dear MATLAB users,
I have encountered the following inefficient storage problem:
delete('myfile.mat')
handle = matfile('myfile.mat')
handle.X = half(X); % X is big
handle.Y = half(Y); % Y is big
handle.a = a;
handle.b = b;
%%% the size of myfile.mat is 2.4Gb %%%
data = load('myfile');
save('mynewfile1.mat', '-v7.3', '-struct', 'data')
%%% the size of mynewfile1.mat is 1.2Gb %%%
data = load('myfile');
save('mynewfile2.mat', '-struct', 'data')
%%% the size of mynewfile2.mat is 1.2Gb %%%
What could be causing this doubling of storage and how can I avoid it without loading and resaving the file.
Update: the problem does not seem to be caused by the -v7.3 flag. I updated the code above to show this.
Thank you for your help.
  30 comentarios
xingxingcui
xingxingcui el 24 de Ag. de 2021
Editada: xingxingcui el 24 de Ag. de 2021
S Priyadharshini
S Priyadharshini el 30 de Ag. de 2021
Myfile and mynewfile2.mat

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by