参考网站:

https://blog.csdn.net/rumswell/article/details/8545087

数据:

R 22*22 double

部分截图如下:

Python读取Matlab的.mat文件-LMLPHP

使用sicpy.io即可.sicpy.io提供了两个函数loadmat和savemat,此处使用loadmat函数

import scipy.io as sio
import numpy as np load_path = 'H:/summer/bf/cut/cc/01.mat'
load_data = sio.loadmat(load_path) print(type(load_data))
print(load_data.keys())
print(load_data.values()) result:

Python读取Matlab的.mat文件-LMLPHP

数据类型转换:
for key, value in load_data.items():
print(key, ':', value)

Python读取Matlab的.mat文件-LMLPHP

即有4个key-value,我们只关心'R'
print(load_data['R'])

Python读取Matlab的.mat文件-LMLPHP

05-11 18:13
查看更多