loading .mat and .m files with loadmat in Python

后端 未结 4 495
时光说笑
时光说笑 2021-01-03 00:33

I am currently taking a Neural Network course, and I am trying to load a .mat file from Python using scipy.io.loadmat(filename), but I keep getting

4条回答
  •  醉酒成梦
    2021-01-03 01:26

    You cannot load .m script-files. These are MATLAB's own script-files and they contain MATLAB code. The function scipy.io.loadmat cannot parse this code.

    On the other hand, the function can load data from a MATLAB .mat-file. This is MATLAB's own data-format within which you store variables and data - but not code.

    Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html.

提交回复
热议问题