I have .mat file which have 3 matrixes A, B, C.
Actually I used scipy.io to import this mat file as below.
data = sio.loadmat('/data.mat')
A = data['A']
B = data['B']
C = data['C']
But, v7.3 file cannot import using this way. So, I tried to import using h5py but I don't know how to use h5py. My code is as below.
f = h5py.File('/data.mat', 'r')
A = f.get('/A')
A = np.array('A')
Which part is wrong? Thank you!
In Octave
In Ipython
See also links in the sidebar.
Basically it's a matter of finding the desired dataset, and then loading it as described in http://docs.h5py.org/en/latest/high/dataset.html#reading-writing-data
https://pypi.python.org/pypi/hdf5storage/0.1.14 - this package has
MATLAB MAT v7.3 file support. I haven't used it yet.So the file has been loaded as a structured array, with shape (1,) and 2 fields, 'A' and 'B' (the 2 variable names). Each in turn has a 'type' and 'value' field.
Or using its
loadmat:outis a dictionary:For reading a simple MATLAB file this doesn't add much. It may add more with cells or structs. But for writing a MATLAB compatible file it should be a big help (though for writing one could stick with
scipy.io.savemat).