comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Talking to Matlab
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Talking to Matlab [message #41127] Thu, 30 September 2004 09:12 Go to next message
rcohen is currently offline  rcohen
Messages: 1
Registered: September 2004
Junior Member
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$
Re: Talking to Matlab [message #41339 is a reply to message #41127] Wed, 06 October 2004 07:11 Go to previous messageGo to next message
p.sommer is currently offline  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
Re: Talking to Matlab [message #41430 is a reply to message #41339] Thu, 21 October 2004 08:32 Go to previous message
p.sommer is currently offline  p.sommer
Messages: 20
Registered: April 2004
Junior Member
p.sommer@comcast.net (Paul) wrote in message news:<c2d97616.0410060611.21b8eb2f@posting.google.com>...
> 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

Update: Anyone interested should contact RSI directly. A solution
does exist, but is not ready for general useage (yet). Also, would
like to gauge interest to justify whether or not a more complete
solution would be useful.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: DISPLAY environment on Mac OS-X
Next Topic: Projection Parameters in ENVI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:13:59 PDT 2025

Total time taken to generate the page: 0.00487 seconds