Re: Talking to Matlab [message #41339 is a reply to message #41127] |
Wed, 06 October 2004 07:11   |
p.sommer
Messages: 20 Registered: April 2004
|
Junior Member |
|
|
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$
Rob,
We *should* be able to figure something out for you. I'm fairly
certain the GetFullMatrix method returns a SAFEARRAY which is not
supported by the IDL 5.5 COM bridge - SAFEARRAY majority is the
opposite of IDL's storage.
I'd suggest we try using the MATLAB Engine which is a lower level C
API. Please contact me directly to discuss in more detail and then we
can share our findings with the group once we have tried a few things.
Thanks,
-Paul
|
|
|