I am trying to use Matlab functions in python and would like to have something similar to the following usage:
import matlab_wrapper
matlab = matlab_wrapper.MatlabSession()
f = lambda x: (1.0*x - 0.5)**2.0
matlab.workspace.fminsearch(f, 1.0)
There are a few Matlab wrappers for Python out there, but I need Matlab to evaluate a Python function which is defined in the console. If this is even possible I would like to extend this to non standard matlab functions such as:
matlab_wrapper.call.('some_matlab_function', python_function, numpy_array)
The alternative is to try to build a wrapper to call my python functions in matlab, bu that would require me writing and compiling python files and executables, and working in two different languages, which I would like to avoid.