Interfacing PHP/Perl with MATLAB

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Binod Pant

    #1

    Interfacing PHP/Perl with MATLAB

    Does any one know of a way to call MATLAB from PHP/Perl? I found the Perl
    module Math:MATLAB , but it seems not to work on Windows, and it's not easy
    to install and use.
    This would enable one to use MATLAB to generate live web content...

    BP


  • Erwin Moller

    #2
    Re: Interfacing PHP/Perl with MATLAB

    Binod Pant wrote:
    Does any one know of a way to call MATLAB from PHP/Perl? I found the Perl
    module Math:MATLAB , but it seems not to work on Windows, and it's not
    easy to install and use.
    This would enable one to use MATLAB to generate live web content...
    >
    BP
    Hi Binod,

    I do not know of a (working) interface, but maybe a few are out there.
    I solved this a few year back in the poor mans way: Via files.
    (That was not PHP, but C, but the approach is the same.)

    Let PHP write a file with instructions/data/whatever, and let Matlab read
    it, do its stuff, and write an output file with results.

    So:
    1) PHP writes a file containing instructions/data.

    2) PHP calls Matlab (via functions like passthru() or something similar)
    Here is an overview of such functions:


    3) PHP reads Matlabs outputfile and proceeds.

    It is not the fastest way to include Matlabs functionality, but it gets the
    job done.

    Just my 2 cent...

    Regards,
    Erwin Moller

    Comment

    • NC

      #3
      Re: Interfacing PHP/Perl with MATLAB

      Binod Pant wrote:
      >
      Does any one know of a way to call MATLAB from
      PHP/Perl? I found the Perl module Math:MATLAB ,
      but it seems not to work on Windows, and it's not
      easy to install and use.
      This would enable one to use MATLAB to generate
      live web content...
      You should consider writing a custom PHP extension for that. MATLAB
      has a C interface:

      http://www.mathworks.com/access/help...echdoc/apiref/

      You can use this interface to write a PHP extension in C to make a
      bridge between PHP and Matlab.

      Cheers,
      NC

      Comment

      Working...