MATLAB load/save changes

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

MATLAB load/save changes

Quentin Spencer
I'm not sure whether to report this as a bug or just as an FYI to the
maintainers, so I'm posting it to both. Back in March, John sent out a
list of new features listed as new in the then-upcoming MATLAB 7. I've
just run into a load/save incompatibility that wasn't in that list.
Trying to load a file saved in MATLAB 7, I got an error. In the
documentation for MATLAB's save function, I found the following:

    By default, MAT-files created with SAVE are compressed and char
arrays are
    encoded using Unicode. These MAT-files cannot be loaded into versions of
    MATLAB prior to MATLAB 7.0. The -V6 option disables these features and
    allows saved MAT-files to load into older versions of MATLAB. To disable
    these features by default, modify the settings in the General->MAT-Files
    preferences panel, accessible via the File->Preferences menu item. With
    compression enabled, saving data that does not compress well takes
    longer. In this case, the -V6 option may be preferable.

The file in question didn't have any char arrays, so I suspect it was
the compression that tripped it up. I looked briefly at the file format
document on their web site:
   
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
It looks like it's all documented--they are using gzip compression on
each variable.

-Quentin


Reply | Threaded
Open this post in threaded view
|

Re: MATLAB load/save changes

Teemu Ikonen
On 18/08/04 14:15, Quentin Spencer wrote:
> I'm not sure whether to report this as a bug or just as an FYI to the
> maintainers, so I'm posting it to both. Back in March, John sent out a
> list of new features listed as new in the then-upcoming MATLAB 7. I've
> just run into a load/save incompatibility that wasn't in that list.
> Trying to load a file saved in MATLAB 7, I got an error. In the
[...]
> It looks like it's all documented--they are using gzip compression on
> each variable.

Since the development version of Octave is starting to support integer
datatypes, maybe the mat5 code needs some revising anyway. It seems that at
the moment writing and reading of all the Matlab number types from int8 to
double are supported, but everything appears as doubles when read into an
Octave array. Since I often work with largish integer matrices with low
dynamic range, I'd really appreciate the memory and disk space savings
coming from a full read/write/in memory support of integers. Do the people
who are implementing the integer datatypes have plans of implementing
loading and saving of them any time soon?

Teemu


Reply | Threaded
Open this post in threaded view
|

MATLAB load/save changes

John W. Eaton-6
In reply to this post by Quentin Spencer
On 18-Aug-2004, Quentin Spencer <[hidden email]> wrote:

| I'm not sure whether to report this as a bug or just as an FYI to the
| maintainers, so I'm posting it to both. Back in March, John sent out a
| list of new features listed as new in the then-upcoming MATLAB 7. I've
| just run into a load/save incompatibility that wasn't in that list.
| Trying to load a file saved in MATLAB 7, I got an error. In the
| documentation for MATLAB's save function, I found the following:
|
|     By default, MAT-files created with SAVE are compressed and char
| arrays are
|     encoded using Unicode. These MAT-files cannot be loaded into versions of
|     MATLAB prior to MATLAB 7.0. The -V6 option disables these features and
|     allows saved MAT-files to load into older versions of MATLAB. To disable
|     these features by default, modify the settings in the General->MAT-Files
|     preferences panel, accessible via the File->Preferences menu item. With
|     compression enabled, saving data that does not compress well takes
|     longer. In this case, the -V6 option may be preferable.
|
| The file in question didn't have any char arrays, so I suspect it was
| the compression that tripped it up. I looked briefly at the file format
| document on their web site:
|    
| http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
| It looks like it's all documented--they are using gzip compression on
| each variable.

Thanks for the pointer.  I think Octave should handle the new file
format, but it is a low priority project for me right now.  If someone
else can contribute the code, that would be helpful.

Since you apparently have access to Matlab 7.0, can you tell us
whether

  int8(5) / int8(3)

returns int8(1) or int8(2)?

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

RE: MATLAB load/save changes

HALL, BENJAMIN            PW
In reply to this post by Quentin Spencer
>> a = int8(5)/int8(3)

a =

    2

>> whos
  Name      Size                    Bytes  Class

  a         1x1                         1  int8 array
  ans       1x1                         1  int8 array

Grand total is 2 elements using 2 bytes

-----Original Message-----
From: John W. Eaton [mailto:[hidden email]]
Sent: Wednesday, September 01, 2004 10:31 AM
To: Quentin Spencer
Cc: [hidden email]
Subject: MATLAB load/save changes


On 18-Aug-2004, Quentin Spencer <[hidden email]> wrote:

| I'm not sure whether to report this as a bug or just as an FYI to the
| maintainers, so I'm posting it to both. Back in March, John sent out a
| list of new features listed as new in the then-upcoming MATLAB 7. I've
| just run into a load/save incompatibility that wasn't in that list.
| Trying to load a file saved in MATLAB 7, I got an error. In the
| documentation for MATLAB's save function, I found the following:
|
|     By default, MAT-files created with SAVE are compressed and char
| arrays are
|     encoded using Unicode. These MAT-files cannot be loaded into versions
of
|     MATLAB prior to MATLAB 7.0. The -V6 option disables these features and
|     allows saved MAT-files to load into older versions of MATLAB. To
disable
|     these features by default, modify the settings in the
General->MAT-Files
|     preferences panel, accessible via the File->Preferences menu item.
With
|     compression enabled, saving data that does not compress well takes
|     longer. In this case, the -V6 option may be preferable.
|
| The file in question didn't have any char arrays, so I suspect it was
| the compression that tripped it up. I looked briefly at the file format
| document on their web site:
|    
|
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.
pdf
| It looks like it's all documented--they are using gzip compression on
| each variable.

Thanks for the pointer.  I think Octave should handle the new file
format, but it is a low priority project for me right now.  If someone
else can contribute the code, that would be helpful.

Since you apparently have access to Matlab 7.0, can you tell us
whether

  int8(5) / int8(3)

returns int8(1) or int8(2)?

Thanks,

jwe