How to read .mat file without using matlab (using Scipy library in Python)

import scipy.io as sio
# read a .mat file
animal = sio.loadmat("animals.mat")

# sample output
{'__header__': b'MATLAB 5.0 MAT-file, Platform: GLNX86, ...
 '__version__': '1.0',
 '__globals__': [],
 'names': 
 'features': a
}
This simple line of code can be used reading .mat file without MATLAB installed in your computer.

No comments:

Post a Comment