I was wondering why a h5 file takes larger space in the harddisk than a normal mat file while the contents are same. I always thought the h5 is the sort of compressed one. The details are below
Using a Matlab 2014b in a 64 bit linux-ubuntu
code 1:
clear,clc
h5create('myfile.h5','/DS1',[900 9000]);
mydata = rand(900,9000);
h5write('myfile.h5', '/DS1', mydata);
data = h5read('myfile.h5','/DS1');
code 2
clear,clc
a=rand(900,9000);
save a a;
The size of the mat file is 2 mb less than the h5 file (61 mb), are there any flags that I am ignoring for h5 saving process?
Per default HDF5 is uncompressed, but it supports different compression filters. gzip is implemented in matlab, you can simply enable it by setting a level higher than 0.
For
ChuckSize
I made a stupid guess which luckily came out with good results, maybe you can try other values if you experience bad results.