The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::Matlab::Engine - Perl extension for using Matlab from within Perl

SYNOPSIS

  use Math::Matlab::Engine;

  $ep = Math::Matlab::Engine->new();

  $ep->PutMatrix('N',2,3,[1,2,3,4,5,6]);

  $n = $ep->GetGetMatrix('N');

  $ep->EvalString("plot(N)");

DESCRIPTION

This module is a wrapper around the C library matlab.h.

CLASS METHODS

  $ep = Math::Matlab::Engine->new();

     creates a new Math::Matlab::Engine object

OBJECT METHODS

  $ep->PutMatrix($name, $rows, $columns, $dataref);

This methods hands a matrix with $column columns and $rows rows to Matlab with the name $name. The data is specified by the arrayref $dataref.

 EXAMPLE: $ep->PutMatrix('N',3,2,[0,8,15,2,3,9]);
writes the matrix "N=[0,8,15;2,3,9]" into matlab's namespace.

  $n = $ep->GetMatrix($name);

This method retrieves the matlab object $name if it represents a two-dimensional matrix, undef otherwise.

  $ep->EvalString($string);

This methods sends an arbitrary string expression to matlab for evaluation, EXAMPLE: $ep->EvalString("[T,Y]=ode23t('func',[0 100],[1,1,1,1])");

  $ep->PutArray($name, $dimlistref, $dataref);

This methods hands a multidimensional array to Matlab with the name $name. The dimensions are defined by the arrayref $dimlistref, the data is specified by the arrayref $dataref.

If $p is a pdl object, one can write "$ep->PutArray($name,[$p->dims],[$p->list]);";

  $n = $ep->GetArray($name);

This method retrieves the matlab object $name as a multidimensional arrayref.

EXPORT

None by default.

BUGS

PutArray whirls around the dimensions. I did not find an elegant solution to this problem. For 2-d arrays, use the Matrix methods.

TODO

The -Array methods have to be corrected to correctly reflect the numbering of the dimensions

AUTHOR

O. Ebenhoeh, <oliver.ebenhoeh@rz.hu-berlin.de>

SEE ALSO

perl.