当前位置:   article > 正文

python读写mat文件_如何在python中读写和存储matlab的数据文件(*.mat)

python读取西储大学mat文件

使用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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/202664
推荐阅读
相关标签
  

闽ICP备14008679号