I use h5py to read a mat file but the size of the loaded file is not the same as the size of the matrix in matlab. My matrix with the name of the 'u' has the size of (155,142,5000) in matlab but when I load the file in python, its size is 110050000 which is equal to 155\times142\times5000=110050000. What should I add to preserve the size of the matrix in python.
import numpy as np
import h5py
Data_Main = h5py.File('mesh_07ms_velocity.mat','r')
print(Data_Main.keys())
u = Data_Main.get('u')
u = np.array(u)
print(u.size)
<KeysViewHDF5 ['u', 'w', 'x', 'z']>
110050000
I tried to read a matfile and expected to have it in size of (155,142,5000) but its size is 110050000. it seems that it loaded continuously.