python save 2d matrix to mat file code example
Example 1: np.save function
np.save('data.npy', num_arr) # save
new_num_arr = np.load('data.npy') # load
Example 2: save np array as mat file
scipy.io.savemat('test.mat', {'mydata': mydata})
np.save('data.npy', num_arr) # save
new_num_arr = np.load('data.npy') # load
scipy.io.savemat('test.mat', {'mydata': mydata})