BarneySimpson has asked for the wisdom of the Perl Monks concerning the following question:
Dear perl monks I am haveing some trouble with Win32::OLE.
First I run Matlab and then the perl code. The command GetActiveObject('Matlab.Application') does not find the existing instance of matlab and so it creates its own with the new('Matlab.Application') command, This command runs Matlab commandline.
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"; }
My question is why is it not finding the instance of matlab aready open. Thank you in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OLE can't find Matlab aready running
by sanju7 (Acolyte) on Oct 04, 2010 at 21:00 UTC |