On 3 Des, 05:02, itcecsa <[EMAIL PROTECTED]> wrote:

> I am implementing a small Python project, what I am going to do is to
> open Matlab and run some M-files, and get some output from Matlab
> command prompt.
>
> I have no idea how to open Matlab from Python!

Do you really want to do that? NumPy, SciPy, Matplotlib, f2py, etc.
are probably a better option. You don't need to rely on Matlab to do
serious numerical and scientific computing in Python. Remember that
NASA uses Python to process image data from the Hubble telescope.

Anyhow... If you really need to do this, there are several ways to
proceed:

* Call the "Matlab engine" using ctypes. There is only nine C
functions you need to wrap, and it should be straight forward. (This
is what I would try first.)

* Use Pyrex or SWIG to generate a wrapper to the Matlab engine C
frontend instead of using ctypes.

* Wrap the six functions in the Matlab engine's Fortran frontend with
f2py.

* Use pywin32 and COM to start Matlab as an ActiveX server
("Matlab.Application").

* Spawn a Matlab process using the subprocess submodule. Communicate
with your Matlab script's standard input and output streams (file id 1
in Matlab).

* See if you can get the old PyMat wrapper for the Matlab engine to
build and work.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to