Possible Duplicate:
Call python function from MATLAB
Is there a way to call functions in a Python script from MATLAB, and if so, how?
Possible Duplicate:
Call python function from MATLAB
Is there a way to call functions in a Python script from MATLAB, and if so, how?
You're trying to do something non-trivial. Matlab doesn't have any binding of Python-scripts, and also I don't know of a really good substitute. You can choose between two roads, maybe one can help you a little bit (though both are non-trivial, just as your task):
In nowadays, Python is a valid substitute for most use cases of Matlab. There are libraries for munerical calculations, scientific routines, a great plotting library and a fantastic community that will try to help you with all your problems. And, it's free.
If you only have a couple of Matlab scripts running or you just started using Matlab I'd recommend consideringa a change of platform. To convert your existing Matlab-scripts, you could try the Open Matlab-Python-Converter.
The cleanest way to execute Python-Code from Matlab is to setup a webservice with Python and call this webservice from Matlab. This sounds really complicated, but it isn't. For small projects, I'd recommend XML-RPC. You can look at my other post to see an example of a small XML-RPC-server. If your methods exist, it'Ss easy to adapt to your needs, just import these methods and offer them as webservice calls.
On the Matlab side, you must stick to third-party tools for connecting to an XML-RPC server, e.g., Apache XML-RPC jars.
It might become complicated when you want to pass in other variables than primitives, e.g., arrays. I have no experience how well this works.