Re: Talking to Matlab [message #41107] |
Fri, 01 October 2004 11:57 |
jnettle1
Messages: 27 Registered: January 2001
|
Junior Member |
|
|
You're using the COM object model to access Matlab from IDL. The idea
behind COM is that it exposes Matlab objects to programmers,
regardless of what language they're using. So, for example, you could
try to make these same calls to Matlab in VB (maybe even an excel
macro, which is VBA), PERL, python, etc. and see if the calls to
Matlab work in those languages. The reason I suggest this is b/c I
tried to make IDL talk to Excel a while back using COM, and got a
weird error that I could never figure out. The same calls worked fine
in both PERL and VB, so I concluded that IDL was screwing up when
making COM calls. You might try the same thing. Good luck.
Jeff
rcohen@raytheon.com (Rob) wrote in message news:<ac2cbce6.0409300812.3b62cd9f@posting.google.com>...
> I'm trying to get and set variables in Matlab from IDL. Using an older
> newsgroup posting of how to do this, I'm able to put an array created
> in IDL into Matlab and see it in Matlab's workspace, but I'm getting a
> "bad variable type" response from Matlab when I try to get the array
> back into IDL. Anyone see what my problem is in the code below? Or, if
> there's a better way to do
> this that would be valuable information as well. This is with IDL 6
> and
> Matlab 6.5 R13. Many thanks.
>
> IDL> oMatlab6=OBJ_NEW('IDLcomIDispatch$PROGID$Matlab_Application_ 6')
> IDL> data=DINDGEN(100)
> IDL> PLOT, data
> IDL> oMatlab6->PutFullMatrix,'fromidl','base',data,data
> IDL> oMatlab6->Execute,'plot(fromidl);'
> IDL> fromMat = oMatlab6->GetFullMatrix('fromidl','base',zreal,zimag)
> % IDLCOMIDISPATCH$PROGID$MATLAB_APPLICATION_6::GETFULLMATRIX: Unable
> to
> call method GETFULLMATRIX.
> Bad variable type.
> % Execution halted at: $MAIN$
|
|
|