I would recommend mlabwrap as a solution for this. I use mlabwrap on a regular (weekly?) Basis, both on Linux and on Windows, through several different versions of Python and several different versions of Matlab. To answer your specific questions:
- mlabwrap will work reliably on different platforms, in versions of Python and Matlab. However, it has limitations, and it will fail reliably if these limits are exceeded. You can usually get around them.
- See my answer here for more information on calling Matlab functions and Matlab scripts via mlabwrap. This answer also describes how to get around one of the main limitations of mlabwrap, i.e. not all Matlab objects can be directly converted to Python objects.
- I don't know anything about calling Matlab using win32com.
I used mlabwrap in what I will call the "Python-primary style", where most Python programs, using Matlab as a library for certain mathematical functions that are not available in scipy / numpy, and in "Matlab-primary", most programs are in Matlab, and the final results are imported into Python for use in some external process.
For Python-primary, it's important to keep in mind that not all Matlab functions return Python-readable data. mlabwrap will return the MLabObjectProxy object from these functions. This usually happens when you use Matlab functions to create objects that are passed to other Matlab functions to actually process the data. For example, you can use the digital signal processing toolbar to create a Welch spectrum object, which you can then use to get the power spectrum of your data. Theoretically, you can pass these MLabObjectProxies into Matlab functions that require them. In my experience, the more you go past them, the more likely you are to find a bug in mlabwrap. Instead, you can write a simple Matlab wrapper function that receives an object, processes the data, and then returns the corresponding result as an array.
You can also work around issues with MLabObjectProxies by using the low level commands in mlabwrap. For example, if I have matlab_struct , which is a struct array with a matlab_struct.label field, and I only want labels on the Python side, I can do the following:
# place matlab_struct into the Matlab workspace mlab._set('matlab_struct', matlab_struct)
The main lower-level commands are available: mlab._set('variable_name', variable) , mlab.eval('command string') and mlab.get('variable_name') .
If I do a lot of processing in Matlab, say in a toolbar or plugin that is not available elsewhere, I will write what I call Matlab-primary code, where I try to avoid passing data back and forth through mlabwrap, instead manipulating variables in the Matlab workspace, invoking .m scripts, saving the result in a data file, and importing it into my Python code.
Good luck