size of .mat file version 7.3

8 visualizaciones (últimos 30 días)
Xuanye Wang
Xuanye Wang el 29 de Feb. de 2020
Editada: per isakson el 29 de Feb. de 2020
I run into this problem that to save a large matrix I must use .mat version 7.3.
Then just curious I run an experiment to compare the size of files saved using v7.3 and an earlier version.
I save a zero matrix of size 2^11 by 10^5. To my surprise, under v7.3 the saved .mat file takes 8642K; otherwise the .mat file takes 709K.
It looks v7.3 takes more space in saving a relatively small data set. Is there a reason behind this?
  3 comentarios
Xuanye Wang
Xuanye Wang el 29 de Feb. de 2020
Hi,
I tried randn(2048,1e5). Actually the saved file are about the same size. The v7.3 file is actually slightly bigger. It seems to me that the compression algorithm in v7.3 may not works that well with a medium size data set.
per isakson
per isakson el 29 de Feb. de 2020
Editada: per isakson el 29 de Feb. de 2020
'-v7.3' creates a hdf5-file, which is supposed to compress each variable separately. That ought to work with your example. For a large number of tiny variables this kind of compression doesn't work at all. Maybe it's possible to investigate what's going on with Matlab's hdf5 tools.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 29 de Feb. de 2020
Yes, there is a reason for it. V7.3 uses a completely different file structure, using an international standard that is designed for portability as a much higher priority than compression. File sizes are often considerably larger than corresponding v7 files, especially for compound data types.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by