MatLab-5 .mat file: Octave fails to read

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

MatLab-5 .mat file: Octave fails to read

Ted.Harding
Someone brought me a diskette today with data computed by MatLab (5.1 I was
told) in a matlab ".mat" file.

Octave failed to read it, both with plain "load quad3.mat" and also with
"load -mat-binary quad3.mat"

Inspection of the file showed "MATLAB 5.0" at the head.

Can anyone comment? This is the first time I've had octave fail to be
matlab-binary compatible!

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <[hidden email]>
Date: 25-Mar-98                                       Time: 01:48:17
--------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

MatLab-5 .mat file: Octave fails to read

John W. Eaton-6
On 25-Mar-1998, (Ted Harding) <[hidden email]> wrote:

| Someone brought me a diskette today with data computed by MatLab (5.1 I was
| told) in a matlab ".mat" file.
|
| Octave failed to read it, both with plain "load quad3.mat" and also with
| "load -mat-binary quad3.mat"
|
| Inspection of the file showed "MATLAB 5.0" at the head.
|
| Can anyone comment? This is the first time I've had octave fail to be
| matlab-binary compatible!

As far as I know, the format for the Matlab 5 binary data file format
has not been published and there is no freely redistributable code to
read the format.

If that's not the case, please correct me.

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

Re: MatLab-5 .mat file: Octave fails to read

John D. Jegla
Hi all.

This problem is killing me too.  I always forget to type "save -v4" in
Matlab, so then Octave can't read the files.

The ftp directory
ftp://ftp://ftp.mathworks.com/pub/tech-support/library/matlab5/extern/
and its subdirs seem to have the header files required to build
Matlab 5.x MAT files.  Not being much of a c/c++ programmer, I don't
know if this information is sufficient or not.  There are also lots
of architecture-dependent libraries for reading and writing MAT files
as well...

Note that "save whatever -v4" is a somewhat viable work-around.  It
has some limitations, however, related to new features in Matlab 5.x:
you can't have multidimensional arrays or structures in a v4 file, and
the data must be all double-precision (which kills me, because I store
most of my data as single byte to save space).

-John Jegla

--
/===================================================\
| John D. Jegla       | E-mail: [hidden email] |
| Vis. Asst. Prof.    | Tel:    (208) 885-4688      |
| Dept. of Chemistry  | Fax:    (208) 885-6173      |
| Univ. of Idaho      |                             |
\===================================================/


Reply | Threaded
Open this post in threaded view
|

Re: MatLab-5 .mat file: Octave fails to read

John W. Eaton-6
On 25-Mar-1998, John D. Jegla <[hidden email]> wrote:

| This problem is killing me too.  I always forget to type "save -v4" in
| Matlab, so then Octave can't read the files.

Sorry, but if there were free code available to read Matlab version 5
files, or if the details of the file format were published somewhere,
Octave could probably support most of the file format, just as it
currently does for the older version 4 file format.

Perhaps you should complain the the MathWorks for having proprietary
data file formats.  But don't expect it to help much.  They will
likely tell you that they have provided `free' (of charge) software to
solve your problem (too bad if your system is not one of the platforms
for which they provide binaries).

| The ftp directory
| ftp://ftp://ftp.mathworks.com/pub/tech-support/library/matlab5/extern/
| and its subdirs seem to have the header files required to build
| Matlab 5.x MAT files.  Not being much of a c/c++ programmer, I don't
| know if this information is sufficient or not.  There are also lots
| of architecture-dependent libraries for reading and writing MAT files
| as well...

You need the libraries too, I think.  As far as I know, the header
files just provide interface and the declarations of functions that
you can call.  I believe the actual functions are distributed in
binary form only, in the libraries that you mention.  Since the
libraries are not free software, they can't be linked with Octave.
Also, as I understand things, it would also be a violation of the GPL
to distribute functions for Octave that provide an interface to the
non-free code, and expect the user to do the link.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: MatLab-5 .mat file: Octave fails to read

Jim Van Zandt

John -

> Also, as I understand things, it would also be a violation of the GPL
> to distribute functions for Octave that provide an interface to the
> non-free code, and expect the user to do the link.

As I remember, the LGPL (Library General Public License) allows the
user to link free code with non-free code, as long as the user can get
the source code for the free part, and upgrade it when he wants.  The
original idea was to allow people to link their proprietary code
against the GNU libraries.  I don't see why it shouldn't work just as
well if the proprietary part is a library and the free part is the
calling program.  Would you consider licensing Octave under the LGPL
as well as the GPL?

                             - Jim Van Zandt


Reply | Threaded
Open this post in threaded view
|

Re: MatLab-5 .mat file: Octave fails to read

John W. Eaton-6
On 25-Mar-1998, Jim Van Zandt <[hidden email]> wrote:

| As I remember, the LGPL (Library General Public License) allows the
| user to link free code with non-free code, as long as the user can get
| the source code for the free part, and upgrade it when he wants.

Yes, when the free part is a library that is used by the non-free
part.

| The original idea was to allow people to link their proprietary code
| against the GNU libraries.

The original idea was that the LGPL might help spread free software
where it would otherwise be ignored, and that using the LGPL might
lead to faster development of free libraries.  That intent is stated
in the preamble of the LGPL.

| I don't see why it shouldn't work just as well if the proprietary
| part is a library and the free part is the calling program.

I'm not sure that this is allowed by the LGPL.  It certainly does not
seem to be the intent of the license.

| Would you consider licensing Octave under the LGPL as well as the
| GPL?

No.

Whether or not it is possible to releas Octave under the terms LGPL of
if doing so would allow such use doesn't matter to me.  I don't want
to release Octave under any different license.  I don't have any
particular desire to help people who won't help me.  I've done quite a
lot of work trying to make Octave useful, and I am making it freely
available to anyone who wants to use it.  Why should I make it any
easier for those who aren't willing to share their software with the
Octave community to take advantage of us?

jwe