Re: Using .sav files outside of IDL [message #54275] |
Tue, 29 May 2007 17:48  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
You'll most likely have to give up on having the structure definition
stored in this file. (I think) the best you will be able to do is stuff
the data into a file in a known order then read it out and construct
your structure on the other side. I recommend XDR because it is so
simple (although I haven't created XDR files in IDL and read them in
MATLAB so who knows what could crop up). There isn't built in support
for MATLAB but libraries are available. Here's one:
http://crppwww.epfl.ch/~moret/matlab/local.html
and there are others. Java based XDR libraries would be trivial to use too.
As someone mentioned, XML is an option is your structures aren't too
"heavy". There are a number of XML parsers on the MATLAB central file
exchange that will read an XML file into a structure but you would still
need to write a function in IDL that would write the XML file to their
specific formats. Probably easier to go the XDR route.
-Rick
skcllus@gmail.com wrote:
> Hello,
>
> I have two structures saved in an IDL .sav file. Do you guys know how
> I can import this data to MATLAB. When I try, it says that .sav file
> is a proprietary format. I have a few IDL procedures that play with
> the data, and I'd like to port them to MATLAB. If it's not possible,
> can you suggest how I should go about saving these structures to a
> format that MATLAB would be able to read (preferably I would like the
> form of the structures preserved so that I won't have to think up new
> code/logic). Should I write to a file? If so, what format should I
> use?
>
> So, how do I save my structure to a non-proprietary format?
>
> Thank you
>
|
|
|