pythoncode in matlab

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sven Jerzembeck

    #1

    pythoncode in matlab

    Hello guys,
    is there any possibiliy using Phython code in Matlab. I couldnt find
    any helpful stuff. Its not graphical stuff I am doing just
    calculations with arrays and strings.

    Thanks for answering in advance

    Sven


  • patrick.d.hull@gmail.com

    #2
    Re: pythoncode in matlab

    check out PyMat:


    I've never used it but I believe it should work for your needs.
    However, I highly recommend taking a look at SAGE:

    which has an interface to octave.

    -ph

    Comment

    • Carl

      #3
      Re: pythoncode in matlab

      patrick.d.hull@ gmail.com wrote:
      [color=blue]
      > check out PyMat:
      > http://claymore.engineer.gvsu.edu/~s...hon/pymat.html
      >
      > I've never used it but I believe it should work for your needs.
      > However, I highly recommend taking a look at SAGE:
      > http://modular.math.washington.edu/sage/
      > which has an interface to octave.
      >
      > -ph[/color]
      PyMat will not help you! PyMat works the other way around, ie it allows for
      Matlab calls from Python.

      Basically you need to build a Python extension which includes calls to the
      matlab engine (see the Python and Matlab manuals). Another way is to make a
      shell call Python directly via "!python -c 'myscript.py'" and possibly save
      the results on a file, for further processing by Matlab.

      If you know about Scilab (which is a free and very capable Matlab clone,
      www.scilab.org) you can take a look at its Matlab-equivalent perl command
      (ie a Matlab script that calls perl). You can use this perl command for
      building a python command in Matlab.

      Carl

      Comment

      • patrick.d.hull@gmail.com

        #4
        Re: pythoncode in matlab

        > PyMat will not help you! PyMat works the other way around, ie it[color=blue]
        > allows for Matlab calls from Python.[/color]

        excuse my ignorance: but why would that not be helpful? I may be
        missing something blindingly stupid (very possible) but it seems to me
        using PyMat would be just as powerful (if not more) as building
        extensions...

        -ph

        Comment

        • Daniel Klünder

          #5
          Re: pythoncode in matlab

          Hi Sven,

          I don't have Matlab on my computer so the following is just a wild guess:

          As far as I know you can include C code into Matlab or at least into
          Simulink. Maybe you could try to execute your Python script in that C code?

          Daniel

          Comment

          Working...