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

Home » Public Forums » archive » Read ".mat" files
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
Read ".mat" files [message #14938] Mon, 12 April 1999 00:00 Go to next message
Alberto Verga is currently offline  Alberto Verga
Messages: 3
Registered: April 1999
Junior Member
Does anyone know how to read binary matlab .MAT files?

".MAT" are binary data files created using the save command in MATLAB,
for example
> a = zeros(100) %define array a(100,100)
> save data a %write array a in file data.mat

Is there any IDL "pro" code to read such files?

Thanks.
A. Verga.

--
verga@marius.univ-mrs.fr
Institut de Recherche sur les Phenomenes Hors Equilibre,
12, av. General Leclerc, F-13003, Marseille, France.
Re: Read ".mat" files [message #15011 is a reply to message #14938] Tue, 13 April 1999 00:00 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
Alberto Verga wrote:
>
> Does anyone know how to read binary matlab .MAT files?
>
> ".MAT" are binary data files created using the save command in MATLAB,
> for example
>> a = zeros(100) %define array a(100,100)
>> save data a %write array a in file data.mat
>
> Is there any IDL "pro" code to read such files?
>
> Thanks.
> A. Verga.
>
> --

I have a .pro which can read simple MATLAB version 4 files.
By simple I mean full and string matrices but not sparse matrices.

Reading MATLAB version 5 files requires you to use the MATLAB library to
access
the data file as the format of the files is not in the public domain.
This
would require writing a LINKIMAGE interface or a DLM to load the
contents into
IDL variables.

If your data is saved by vn. 4, or you can save it as vn. 4 then you
could try my
routine to see if it loads your data.

BTW, it won't convert the "endian-ness" of the data. The MATLAB data
files must
be the same as the machine architecture.

If you would like to try it, e-mail me and I will send you a copy.

--
-----------------------------------------------------------
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 2523568, Fax : +44 (0)116 2523555
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: arrays within structures
Next Topic: renaming idl-mode.el for GNU Emacs

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

Current Time: Wed Oct 08 20:02:44 PDT 2025

Total time taken to generate the page: 0.01558 seconds