IDL reader for matlab .mat files [message #39503] |
Fri, 21 May 2004 08:32  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
I realise this question has come up previously, but does anyone know where one can get
their hands on a IDL software to read matlab ".mat" files. I've seen posts for v4 matlab
files, but thats a pretty old matlab version (I think v6 is the current one.)
Thanks,
paulv
|
|
|
Re: IDL reader for matlab .mat files [message #39558 is a reply to message #39503] |
Tue, 25 May 2004 01:55  |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
Paul Van Delst wrote:
> Hello,
>
> I realise this question has come up previously, but does anyone know
> where one can get their hands on a IDL software to read matlab ".mat"
> files. I've seen posts for v4 matlab files, but thats a pretty old
> matlab version (I think v6 is the current one.)
>
> Thanks,
>
> paulv
>
MATLAB itself is up to version 6 (and has been for a while) but the data
formats are either V4 or V5. MATLAB 6 can use both.
The original version (commonly called V4) was used up to and including
MATLAB 4. This was a nice simple format for storing 2-D matrices.
The new version (usually called V5) was introduced in MATLAB 5 to store the
new, more complicated data types which MATLAB 5 could use such as cells and
structures. This is way more complicated to read since cells can contain
structures which can contain structures which can contain cells... i.e it
requires a recursive reading ability.
MATLAB can still use the old format data if you only want to store simple
2-D matrices of floating point data. When creating the data file you simple
add the -V4 flag to the output command.
I have code which can load V4 data into IDL, so if you can store your data
in this format you might be ok. It's very simple and won't take care or
endianness (but that could be fixed) but it loads 2-d matrices.
I also have C code which can read V5 data files (and an interface to load
the data into Python) but nothing to load it into IDL. All it requires is
wrapping in a DLM...
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
|
|