mat 文件处理
MATLAB保存.mat文件时,有两个内容保存
save('/home/awen/Juanjuan/wavefront-cnn/data/d=1r0=0.1test.mat', 'sc', 'slope');
那么在Python中读取的时候,读取得到的是字典格式。
import scipy.io as scio
data_path = '/home/awen/Juanjuan/wavefront-cnn/data/d=1r0=0.1test.mat'
data = scio.loadmat(data_path)
sc_test = data['sc']
slope_test =data['slope']
Python 保存.mat文件格式
#dict是字典格式
scio.savemat('/home/awen/Juanjuan/compressed_sensing/TVAL3_beta2.4/test.mat', dict)