save np array as mat file

scipy.io.savemat('test.mat', {'mydata': mydata})

Here is what the above code is Doing:
1. Create a dictionary with the data you want to save.
2. Call scipy.io.savemat() to save the dictionary to a MATLAB file.

The savemat() function takes two arguments:
1. The name of the file to save the data to.
2. The dictionary to save.

The dictionary must contain the data you want to save. The keys of the dictionary are the names of the variables in the MATLAB file. The values of the dictionary are the values of the variables.

The savemat() function can save data in two formats:
1. Version 4: This is the default format. It is compatible with MATLAB versions 4 and 5.
2. Version 7.3: This format is compatible with MATLAB versions 7.3 and later.

To save data in the version 7.3 format, you must pass the format=’7.3′ argument to the savemat() function.