[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python from Matlab



Hi Alain,

The few times I had to do that, I actually programmed everything in Python using mlabwrap, and called the script with a system command from Matlab...

Another option seem to be using JPython, the Java implementation of Python, which can be fully integrated in Matlab's Java interface, but I must admit I have no clue how (and I hear that not all libraries are implemented in JPython).

Otherwise, it looks like someone wrote a client/server interface:
https://code.google.com/p/python-matlab-wormholes/
Haven't tried it though.

Good luck!
-Etienne


On 22/08/2014 23:30, Alain de Cheveigne wrote:
[To list members not interested in Matlab, etc.: apologies for the annoyance.  The discussion is somewhat relevant to audition, in that modeling, experiment control, and data analysis increasingly rely on computers, and the choice of a high-quality computation environment is crucial.]
Hi Jan,

A client/server solution indeed sounds ideal.  I don't know what it involves in terms of programming effort, but I'm sure that effort would be well spent.

The ideal solution would be:
- simple to use, like calling "result=toPython('pythonFunction',arguments);"
- efficient, i.e. minimal overhead for data transfer,
- reliable, system-independent, and future-proof,
- secure.

Several people mentioned calling Python via a shell command, passing values by file, etc.   I'm concerned that these solutions might involve greater overhead, more complex syntax, possibly greater system dependencies, and possibly security issues.

Alain



On 22 Aug 2014, at 13:47, Jan Schnupp <jan.schnupp@xxxxxxxxxxxxx> wrote:

Or you could
python and matlab work together on some sort of client/server model.
That would be more elegant - the matlab and python parts then wouldn't
even have to be on the same machine, but the programming investment is
very large. I don't know of any developments to make this sort of
stuff easier that are even on the distant horizon. If other list
members know of any I would be interested to hear about them.

--
Etienne Gaudrain, PhD
UMCG, Afdeling KNO, BB20
PO Box 30.001
9700 RB Groningen, NL

Room P3.236
Phone +31 5036 13290
Skype egaudrain

Note: emails to this address are limited to 10 MB. To send larger files, use egaudrain.cam@xxxxxxxxx.