reading v 7.3 mat file in python

后端 未结 8 1767
情书的邮戳
情书的邮戳 2020-12-02 09:16

I am trying to read a matlab file with the following code

import scipy.io
mat = scipy.io.loadmat(\'test.mat\')

and it gives me the followin

8条回答
  •  春和景丽
    2020-12-02 09:45

    According to the Scipy cookbook. http://wiki.scipy.org/Cookbook/Reading_mat_files,

    Beginning at release 7.3 of Matlab, mat files are actually saved using the HDF5 format by default (except if you use the -vX flag at save time, see help save in Matlab). These files can be read in Python using, for instance, the PyTables or h5py package. Reading Matlab structures in mat files does not seem supported at this point.

    Perhaps you could use Octave to re-save using the -vX flag.

提交回复
热议问题