【求助】Perl运行matlab的m文件

【求助】Perl运行matlab的m文件

求助啊,perl要怎么来运行matlab写的m文件啊?
matlab可以生成exe,但是我想要在linux下运行的话会比较麻烦,所以我希望能直接运行matlab的代码,就是那些m文件。
前提是在linux会有matlab这个软件。要怎么做啊?各位大虾救命啊!
在cpan上搜索了一下, 好像

    Math::Matlab

能够解决你的问题, enjoy。。。
利用OLE调用
#!/usr/bin/perl -w
use Win32::OLE;
use Win32::OLE::Variant;

# Simple perl script to execute commands in MATLAB.
# The name Win32::OLE is misleading; this actually uses COM

# Use existing instance if MATLAB is already running.
eval {$ml = Win32::OLE->GetActiveObject('Matlab.Application')};
die "MATLAB not installed" if $@;
unless (defined $ml) {
$ml = Win32::OLE->new('Matlab.Application')
or die "Oops, cannot start MATLAB";
}

# Execute the function in MATLAB and retrieve the results in a Variant array.

$ml->Execute('magicArray = magic(4)');

$mReal = Variant(VT_ARRAY|VT_R8|VT_BYREF,4,4);
$mImag = Variant(VT_ARRAY|VT_R8|VT_BYREF,4,4);
print "\n>> GetFullMatrix('magicArray', 'base', ",'$mReal, $mImag',")\n";
$ml->GetFullMatrix('magicArray', 'base', $mReal, $mImag);

for ($i = 0; $i < 4; $i++) {
   printf "%3d %3d %3d %3d\n", $mReal->Get($i,0), $mReal->Get($i,1),
$mReal->Get($i,2), $mReal->Get($i,3);
}

undef $ml; # close MATLAB if we opened it