参考网站:
https://blog.csdn.net/rumswell/article/details/8545087
数据:
R 22*22 double
部分截图如下:
使用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:
数据类型转换:
for key, value in load_data.items():
print(key, ':', value)
即有4个key-value,我们只关心'R'
print(load_data['R'])