Loading of Matlab 5 Files

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

Loading of Matlab 5 Files

Andreas.Weingessel


The format of the Matlab-binary-files is in Matlab 5 different from
Matlab 4. My current octave version 2.0.9 can not read Matlab 5 binary
files. I also did not find anything about loading Matlab 5 files in
the NEWS of octave 2.1.2.

Are there any plans for the future to allow reading Matlab 5 files
in octave?

Thanks,
        Andreas

************************************************************************
*                          Andreas Weingessel                          *
************************************************************************
* Institut für Statistik      *                Tel: (+43 1) 58801 4541 *
* Technische Universität Wien *                Fax: (+43 1)  504 14 98 *
* Wiedner Hauptstr. 8-10/1071 *     [hidden email] *
* A-1040 Wien, Austria        * http://www.ci.tuwien.ac.at/~weingessel *
************************************************************************


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

Martin Holz-2
[hidden email] writes:
> The format of the Matlab-binary-files is in Matlab 5 different from
> Matlab 4. My current octave version 2.0.9 can not read Matlab 5 binary
> files. I also did not find anything about loading Matlab 5 files in
> the NEWS of octave 2.1.2.
>
> Are there any plans for the future to allow reading Matlab 5 files
> in octave?

Hello Andreas,
MATLAB v5 can save data in a v4-compatible way, if you don't use
the new features of v5.  


>From help save:
SAVE fname X Y Z  -v4  saves a MAT-file that MATLAB 4 can LOAD.


Martin


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

Andres Weingessel
>>>>> On 14 Oct 1997 10:30:22 +0200,
>>>>> Martin Holz (MH) wrote:

MH> [hidden email] writes:
>> The format of the Matlab-binary-files is in Matlab 5 different from
>> Matlab 4. My current octave version 2.0.9 can not read Matlab 5 binary
>> files. I also did not find anything about loading Matlab 5 files in
>> the NEWS of octave 2.1.2.
>>
>> Are there any plans for the future to allow reading Matlab 5 files
>> in octave?

MH> Hello Andreas,
MH> MATLAB v5 can save data in a v4-compatible way, if you don't use
MH> the new features of v5.  


MH> From help save:
MH> SAVE fname X Y Z  -v4  saves a MAT-file that MATLAB 4 can LOAD.

Thank you. I know this option. The reason of my question was that the
exchange of data with Matlab users becomes more difficult, when you
have to ask them to save the data in a special way. So, if octave
still wants to be matlab-compatible in the way that I can write programs
which can be used in octave as well as in matlab, then the
implementation of the new binary format seems to be necessary.

        Andreas



Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

John W. Eaton-6
On 15-Oct-1997, Andres Weingessel <[hidden email]> wrote:

| >>>>> On 14 Oct 1997 10:30:22 +0200,
| >>>>> Martin Holz (MH) wrote:
|
| MH> Hello Andreas,
| MH> MATLAB v5 can save data in a v4-compatible way, if you don't use
| MH> the new features of v5.  
|
| MH> From help save:
| MH> SAVE fname X Y Z  -v4  saves a MAT-file that MATLAB 4 can LOAD.
|
| Thank you. I know this option. The reason of my question was that the
| exchange of data with Matlab users becomes more difficult, when you
| have to ask them to save the data in a special way. So, if octave
| still wants to be matlab-compatible in the way that I can write programs
| which can be used in octave as well as in matlab, then the
| implementation of the new binary format seems to be necessary.

Are the specs for the Matlab 5 binary file format publicly available?
If so, would anyone be interested in writing the code for Octave?

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

Andy Adler-4
In reply to this post by Andreas.Weingessel
>| MH> MATLAB v5 can save data in a v4-compatible way, if you don't use
>| MH> the new features of v5.  
>| MH> From help save:
>| MH> SAVE fname X Y Z  -v4  saves a MAT-file that MATLAB 4 can LOAD.
>|
>| Thank you. I know this option. The reason of my question was that the
>| exchange of data with Matlab users becomes more difficult, when you
>| have to ask them to save the data in a special way. So, if octave
>| still wants to be matlab-compatible in the way that I can write programs
>| which can be used in octave as well as in matlab, then the
>| implementation of the new binary format seems to be necessary.
>
>Are the specs for the Matlab 5 binary file format publicly available?
>If so, would anyone be interested in writing the code for Octave?

It doesn't appear to be that way...
I just looked at http://www.mathworks.com/support/solutions/v4/7279.html
_____________________________________________________________________
Problem
Is there any documentation on the structure of  MAT-Files in MATLAB 5?

Solution
Currently, there is no documentation available regarding the MATLAB 5
MAT-File structure. There are no plans to publish this information.
We recommend using our MAT routines for creating MAT-files in MATLAB 5.

Please note that MATLAB 5 does still read MATLAB 4.x MAT-files.
Therefore, if you have code that you used in MATLAB 4.x to create
MAT-files, you can still create MAT-files with this code and read the
MAT-files into MATLAB 5.

You will not have access to the new data types supported in MATLAB 5
if you use your old code.  For this, we recommend using the MAT
routines provided in the MATLAB Programming Interface.
[ cut ]
Date Last Modified: Jul 31 1997
_____________________________________________________________________

<rant>
This really offends me. I'm not as diehard a free software fan
as some. But, after all, it is _MY_ data. If I save data with Matlab,
then they got me locked into buying Matlab to access my data.

Sorry for whining in the forum. I'll go and whine on
comp.soft-sys.matlab as penance.
</rant>

I would offer to take on this project. But unless Matlab changes their
mind... there's not much I could do. On the other hand, we could
try to reverse engineer the interface, but then we're not garuanteed
that what we have won't change with the next version.
_____________________________________________________________________
Andy Adler,    | Pulmonary Physiology Unit         | Lab 303-398-1626
[hidden email] | National Jewish Center,Denver,USA | Fax 303-398-1607

   For the Snark _was_ a Boojum, you see.    -Lewis Carroll


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

Andy Adler-4
On Fri, 17 Oct 1997, Andy Adler wrote:
> >Are the specs for the Matlab 5 binary file format publicly available?
> >If so, would anyone be interested in writing the code for Octave?
> It doesn't appear to be that way...
> I just looked at http://www.mathworks.com/support/solutions/v4/7279.html

To follow up my own post, I found a description of
how to do this at
 http://www.mathworks.com/support/solutions/v4/8757.html

Basically, it's a library with appropriate functions to
manipulate .mat files. You get the *.h and *.so files
for your architecture at
 ftp://ftp.mathworks.com/pub/tech-support/library/extern/lib/YOUR_ARCH

and then you compile it with the switches given in

ftp.mathworks.com/pub/tech-support/library/matlab5/bin/readmemat.txt

There is an example at

ftp.mathworks.com/pub/tech-support/library/extern/examples/mex/mexload.c

In Linux, you compile with
gcc -ansi -I<include dir> -o <result> <source> -L<libdir> -lmat -lmx

after you get the following libraries and include files
libmat.so, libmx.so, libmi.so, libut.so, mat.h, matrix.h

Mathworks justification for this is:
> Updating the Libraries
>
> The API libraries are subject to change. However, it is not necessary
> for you to recompile your MAT-file applications each time the libraries
> change. If you update the shared libraries on your system by copying down
> the latest versions from The MathWorks FTP site and replacing the old ones
> with the new ones, your MAT-file applications will use the new version.

I don't know if this is a tolerable solution for octave though.

Can mathworks libraries be included along with GPL source?

Or can the source contain the hooks and have a message for the
user to ftp the libraries him/herself?

Any other ideas?
___________________________________________________________________
Andy Adler,    | Pulmonary Physiology Unit         | Lab 303-398-1626
[hidden email] | National Jewish Center,Denver,USA | Fax 303-398-1607

   For the Snark _was_ a Boojum, you see.    -Lewis Carroll


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

John W. Eaton-6
On 17-Oct-1997, Andy Adler <[hidden email]> wrote:

| To follow up my own post, I found a description of
| how to do this at
|  http://www.mathworks.com/support/solutions/v4/8757.html
|
| Basically, it's a library with appropriate functions to
| manipulate .mat files. You get the *.h and *.so files
| for your architecture at
|  ftp://ftp.mathworks.com/pub/tech-support/library/extern/lib/YOUR_ARCH

  ...

| I don't know if this is a tolerable solution for octave though.

It's not, because the libraries from the MathWorks are apparently not
free software.

| Can mathworks libraries be included along with GPL source?

You have to be precise about exactly what you mean by `included along
with'.  If you mean, ``can proprietary libraries be linked with code
that is distributed under the terms of the GPL?'' then the answer is
no, because linking them together creates a derivative work, and to do
that, the GPL says that you must be able to distribute the result
under the terms of the GPL.  You can only do that if the distribution
terms for all the code is compatible with the GPL.  For this case, it
would mean that you would need to be able to get source for the
MathWorks' libraries and have the right to freely redistribute
modified versions.

| Or can the source contain the hooks and have a message for the
| user to ftp the libraries him/herself?

No.  You can't avoid the terms of the GPL simply by having the user
perform the linking step.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

Doug Warner-2
>>>>> "jwe" == John W Eaton <[hidden email]> writes:

[discussion of using the Mathworks MAT-file library routines to
 read/save v5 mat-files deleted]

    jwe> You have to be precise about exactly what you mean by `included along
    jwe> with'.  If you mean, ``can proprietary libraries be linked with code
    jwe> that is distributed under the terms of the GPL?'' then the answer is
    jwe> no, because linking them together creates a derivative work, and to do
    jwe> that, the GPL says that you must be able to distribute the result
    jwe> under the terms of the GPL.  You can only do that if the distribution
    jwe> terms for all the code is compatible with the GPL.  For this case, it
    jwe> would mean that you would need to be able to get source for the
    jwe> MathWorks' libraries and have the right to freely redistribute
    jwe> modified versions.

This is a bit bothersome, I think.  Does this not then imply that any
oct-functions I write *must* be freely distributable?  What does the
LGPL say about this?

Doug Warner


Reply | Threaded
Open this post in threaded view
|

Re: Loading of Matlab 5 Files

John W. Eaton-6
On 18-Oct-1997, Doug Warner <[hidden email]> wrote:

| >>>>> "jwe" == John W Eaton <[hidden email]> writes:
|
| [discussion of using the Mathworks MAT-file library routines to
|  read/save v5 mat-files deleted]
|
| jwe> You have to be precise about exactly what you mean by `included along
| jwe> with'.  If you mean, ``can proprietary libraries be linked with code
| jwe> that is distributed under the terms of the GPL?'' then the answer is
| jwe> no, because linking them together creates a derivative work, and to do
| jwe> that, the GPL says that you must be able to distribute the result
| jwe> under the terms of the GPL.  You can only do that if the distribution
| jwe> terms for all the code is compatible with the GPL.
|
| This is a bit bothersome, I think.  Does this not then imply that any
| oct-functions I write *must* be freely distributable?

If you choose to distribute them, yes.  The GPL does not say that you
must distribute your changes, but it does say *how* you can distribute
your changes, if you want to distribute them.  Distributing .oct files
amounts to distributing a modified version of Octave, because the two
must be linked together for the .oct files to work.

| What does the LGPL say about this?

It doesn't really matter, since Octave is not distributed under the
terms of the LGPL, nor is a switch likely to happen.  However, if
Octave were distributed under the terms of the LGPL, I believe
distributing .oct files as binaries only or in some other non-free
form would be allowed, provided that you distributed the source
(including any changes you have made) for the code covered by the
LGPL.

jwe