bugGNU Octave - Bugs: bug #45706, Unable to load -v7.3 MAT-file...


bug #45706: Unable to load -v7.3 MAT-file containing cells

Submitter:  Marco Caliari <caliari>
Submitted:  Thu 06 Aug 2015 03:04:58 PM UTC
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Tue 14 Apr 2020 06:12:18 PM UTC, comment #12: 

This is just an intermediate step, but I changed the documentation for load() and save() to indicate that -v7.3 format is not yet implemented in Octave.  I also changed the C++ code to recognize an attempt to use -v7.3 format and throw an error about the format not being supported.  I made the change on the stable branche here https://hg.savannah.gnu.org/hgweb/octave/rev/87554d9ac6f8.

Rik <rik5>
Project Administrator
Fri 20 Mar 2020 10:00:05 PM UTC, comment #11: 

This could, at the very least, be documented.  Matlab has both v7 and v7.3 formats (see https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html).  Octave only claims to load v7 format, which is correct.  The help text is

     Save the data in MATLAB's v7 binary data format.

     Save the data in MATLAB's v6 binary data format.

     Save the data in the binary format written by MATLAB version

What about adding

    Octave does *not* support MATLAB's v7.3 binary data format.

to the documentation.

Rik <rik5>
Project Administrator
Wed 18 Mar 2020 07:36:14 PM UTC, comment #10: 

There are third opensource implementations of v7.3 MAT-file available, so porting this to Octave shouldn't require redo this from scratch.

Also, given that the v7.3 MAT-file is Matlab's default and the only one option in Matlab that can cope with variables larger than 2GB (which is not that much nowadays), we, (some) Octave users, feel that it would be nice if developers could prioritize this Matlab compatibility issue a little.

avlas <kupiqu>
Wed 18 Mar 2020 12:57:11 PM UTC, comment #9: 

Two years later... any news?

Marco Caliari <caliari>
Project Member
Fri 16 Mar 2018 09:10:53 PM UTC, comment #8: 

Yes, libmatio is GPL compatible and may be linked to from Octave.

Mike Miller <mtmiller>
Project Administrator
Fri 16 Mar 2018 09:02:20 PM UTC, comment #7: 

Is matio's BSD license sufficiently compatible with Octave's GPL3?

Philip Nienhuis <philipnienhuis>
Project Member
Fri 16 Mar 2018 06:54:05 PM UTC, comment #6: 

The lack of compatibility between Matlab and Octave with respect to mat files in 7.3 format means that there is no way by which variables > 2GB can be shared between Matlab and Octave users.

A way to fix this lack of compatibility would be porting (or supporting) the MATLAB MAT File I/O Library:


avlas <kupiqu>
Thu 29 Dec 2016 10:33:23 PM UTC, comment #5: 

This behavior is still the same in Octave 4.2.0.

Hartmut <hardy>
Fri 07 Aug 2015 06:30:50 AM UTC, comment #4: 

Hi Rik,

test73m.mat can be loaded without any problem. I knew that, and that is why I thought the problem in my original report was a bug or a compatibility issue, not a feature request.
test73c.mat cannot be loaded.

Why don't add a sentence like "MATLAB version 7.3 is not fully supported", just below -v7 option in load help?



Marco Caliari <caliari>
Project Member
Thu 06 Aug 2015 03:56:34 PM UTC, comment #3: 

I'm not sure Octave supports '-v7.3' at all.  The list of MAT-file formats is here http://www.mathworks.com/help/matlab/import_export/mat-file-versions.html.  When I check Octave's own documentation for the load function with 'help load' I see that the latest is '-v7'.  Trying this with your example file I get some more information.

load -v7 test73.mat
warning: load: found version 2 binary MAT file, but only prepared for version 1
error: load: invalid element type = 0
error: load: trouble reading binary file 'test73.mat'

Using the original syntax I get

load test73.mat
warning: load: can't read 'a' (unknown datatype)

There is some difference between scalars and arrays.  Could you try creating a true cell array and seeing if it works?

a = cell (2,2)
a{1,2} = 1;

And is it only cells, or is everything broken?

a = zeros (2,2)
a(1,2) = 1;

Rik <rik5>
Project Administrator
Thu 06 Aug 2015 03:44:15 PM UTC, comment #2: 

Octave's load function is only expected to be able to read HDF5 files that are created by Octave's save function in HDF5 format.  It is not expected to work for Matlab's new HDF5-based MAT file format, or any other arbitrary HDF5 files.

I've marked this as a feature request.

I bet this is also a duplicate of another report, but I haven't checked.

John W. Eaton <jwe>
Project Administrator
Thu 06 Aug 2015 03:05:33 PM UTC, comment #1: 

The attachment...


(file #34580)

Marco Caliari <caliari>
Project Member
Thu 06 Aug 2015 03:04:58 PM UTC, original submission:  

Dear all,

the attached file was created in Matlab with


If I try to load it in Octave 3.8.2 I get

octave:1> load 'test73.mat'
warning: load: can't read 'a' (unknown datatype)
error: octave_base_value::load_binary(): wrong type argument '<unknown type>'
error: load: error while reading hdf5 item a
HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 140151177508800:
  #000: ../../../src/H5Gdeprec.c line 780 in H5Giterate(): group iteration failed
    major: Symbol table
    minor: Iteration failed
  #001: ../../../src/H5Gint.c line 844 in H5G_iterate(): error iterating over links
    major: Symbol table
    minor: Iteration failed
  #002: ../../../src/H5Gobj.c line 708 in H5G__obj_iterate(): can't iterate over symbol table
    major: Symbol table
    minor: Iteration failed
  #003: ../../../src/H5Gstab.c line 566 in H5G__stab_iterate(): iteration operator failed
    major: Symbol table
    minor: Can't move to next iterator location
  #004: ../../../src/H5B.c line 1298 in H5B_iterate(): B-tree iteration failed
    major: B-Tree node
    minor: Iteration failed
  #005: ../../../src/H5B.c line 1221 in H5B_iterate_helper(): iterator function failed
    major: B-Tree node
    minor: Unable to list node
  #006: ../../../src/H5Gnode.c line 1039 in H5G__node_iterate(): iteration operator failed
    major: Symbol table
    minor: Can't move to next iterator location



Marco Caliari <caliari>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #34580:  test73.mat added by caliari (4KiB - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by kupiqu (Posted a comment)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by caliari (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.





    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-01 mtmiller Release3.8.2 dev
    2018-03-16 mtmiller Dependencies- bugs #53361 is dependent
    2015-12-22 mtmiller CategoryNone Interpreter
    2015-08-06 rik5 Item GroupFeature Request Matlab Compatibility
        StatusNone Confirmed
    2015-08-06 jwe Item GroupMatlab Compatibility Feature Request
    2015-08-06 caliari Attached File- Added test73.mat, #34580

    Back to the top

    Powered by Savane 3.9