To call a matlab function from python you have several options:
- Use a matlab wrapper (mlabwrap, pymatlab)
- Compile matlab into a c/c++ library and call that
- Compile matlab into java and call using jython
- Compile matlab into .net and call from ironpython
- Compile matlab into java/c#, set up as a service and call the service.
Because the first option is the easiest one with the least overhead I'll explain that one. Follow the following steps:
- install matlab (and add matlab to your path)
- install pythonxy
- install a compiler (mingw, visual studio)
- download mlabwrap
- python ./setup.py build (you can skip this if you'll know that it will work)
- test
- python ./setup.py install
In python you can call:
from mlabwrap import mlab mlab.addpath('openearthpath') mlab.oetsettings() mlab.rws_getdatainpolygon()