i have a .mat file.I want to read its each column and want to save each column to separate text file like data_1.txt data_2.txt....data_10.txt
My script is
import numpy as np
import h5py
c1 = h5py.File('test_data.mat', 'r')
out1=c1.get('dat')
for x in range(10):
dd=out1[x]
np.savetxt('data_x.txt', dd,fmt='%10.2f')
But it doesnot write to separate text file, can anybody suggest a better solution for the same. Thanks.