2011年3月8日火曜日

How to write MATLAB .mat by python (scipy)

Thanks to my colleague, we found how to write a .mat file.

The following is how to read a .mat file
http://mzmttks.blogspot.com/2011/01/how-to-read-matlab-mat-by-python-scipy.html






import numpy
import scipy.io.matlab.mio

outdict = {'string':'string', 'value':2, 'complex':1+3j,
'array':numpy.ones([2,3],'float')}
obj = scipy.io.matlab.mio.MatFile5Writer(open('hoge.mat','w'))
obj.put_variables(outdict)

0 件のコメント:

コメントを投稿