Monday, September 4, 2017

matlab mat file in python

import scipy.io as sio
test = sio.loadmat('test.mat')
test
{'a': array([[[  1.,   4.,   7.,  10.],
        [  2.,   5.,   8.,  11.],
        [  3.,   6.,   9.,  12.]]]),
 '__version__': '1.0',
 '__header__': 'MATLAB 5.0 MAT-file, written by
 Octave 3.6.3, 2013-02-17 21:02:11 UTC',
 '__globals__': []}
>>> oct_a = test['a']
>>> oct_a

No comments:

Post a Comment