demo_scipy_matlab_arrays2.py:
from scipy import io import numpy as np arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9,]) #Export: io.savemat('arr.mat', {"vec": arr}) #Import: mydata = io.loadmat('arr.mat') print(mydata['vec'])
C:\Users\My Name>python demo_scipy_matlab_arrays2.py
[[0 1 2 3 4 5 6 7 8 9]]