|
Everything Else
Calling MATLAB functions from
Python
I figured this out by foraging through several forums etc. Hope it saves you some trouble. OS: Ubuntu 9.10 Use python>=2.4 to be safe (I used 2.6) Install python-dev eg. python2.6-dev Install numpy, csh Use compatible gcc 4.3 for matlab 2009a (Check MATLAB docs for your version) Download mlabwrap Set environment variables in the setup.py file Build and install export MLABRAW_CMD_STR=<your path to>/bin/matlab All you need to do now is import and use! e.g. from mlabwrap import * mlab.plot([1,2,3],'-o') Go back home |