赞
踩
使用sicpy.io即可.sicpy.io提供了两个函数loadmat和savemat,非常方便.
以前也有一些开源的库(pymat和pymat2等)来做这个事,
不过自从有了numpy和scipy以后,这些库都被抛弃了.
scipy.io.loadmat(file_name, mdict=None, appendmat=True, **kwargs)[source]
Load MATLAB file
Parameters :
file_name : str
Name of the mat file (do not need .mat extension if appendmat==True) Can also pass open file-like object.
m_dict : dict, optional
Dictionary in which to insert matfile variables.
appendmat : bool, optional
True to append the .mat extension to the end of the given filename, if not already present.
byte_order : str or None, optional
None by default, implying byte order guessed from mat file. Otherwise can be one of (‘native’, ‘=’, ‘little’, ‘’).
mat_dtype : bool, optional
If True, return arrays in same dtype as would be loaded into MATLAB (instead of the dtype with which th
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。