HenrikBengtsson / R.matlab

R package: R.matlab
https://cran.r-project.org/package=R.matlab
85 stars 25 forks source link

WISH: Add support for v7.3 MAT files (HDF5) to readMat() #20

Open HenrikBengtsson opened 9 years ago

HenrikBengtsson commented 9 years ago

In MATLAB v7.3 and above, there's a new MAT file format labelled "v7.3" and are saved in MATLAB using version argument -v7.3. This creates a MAT file that is in the HDF5 file format (confirmed by http://www.mathworks.com/matlabcentral/newsreader/view_thread/235550).

By utilizing one of the R packages that reads HDF5 files (e.g. rhdf5), we could have readMat() automatically support v7.3 MAT files as well. In order to do this, small test files needs to be created, tests needs to be written and sustainable HDF5 R packages need to be identified.

HenrikBengtsson commented 9 years ago

As a start, readMat() should at least recognize MAT v7.3 files and give an informative error message. This requires updating the code that parses the beginning of MAT files to decide what MAT file format version the file has. See https://www.hdfgroup.org/HDF5/doc/H5.format.html#Superblock for HDF5 file signatures.

Moved this comment to it's own Issue #23. Issue #23 needs to resolved before this issue (#22) can be attacked/resolved.

Lvulis commented 3 years ago

+1

zeehio commented 2 years ago

To anyone who wants to read v7.3 MAT files, I would suggest raveio::read_mat(). It worked fine for me.