python 保存mat文件输出格式

1. 直接格式化输出

 

import scipy.io as sio

vectors_test = [1, 2]
SNR = [5, 10]
for i in range(2):
    NR1 = SNR[i]
    sio.savemat("%d dB" % NR1, {"v": vectors_test})

输出:

 

2.   先用path设置文件名

 

import scipy.io as sio
vectors_test = [1,2]
SNR = [1,2]
for i in range(2):
    NR1 = SNR[i]
    path =  str(NR1) + 'DB'
    sio.savemat(path,{"v":vectors_test})

输出

你可能感兴趣的:(python)