use Win32::OLE; # 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"; }