scipy save various variables in matlab workspace code example Example: save np array as mat file scipy.io.savemat('test.mat', {'mydata': mydata})