Check out example codes for "numpy array to matlab mat". It will help you in understanding the concepts better.

Code Example 1

import numpy as np
import scipy.io

x = np.linspace(0, 2 * np.pi, 100)
y = np.cos(x)

scipy.io.savemat('test.mat', dict(x=x, y=y))

Learn ReactJs, React Native from akashmittal.com