R.matlab icon indicating copy to clipboard operation
R.matlab copied to clipboard

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

Open HenrikBengtsson opened this issue 9 years ago • 3 comments

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 avatar Sep 02 '15 17:09 HenrikBengtsson

~~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.

HenrikBengtsson avatar Sep 06 '15 20:09 HenrikBengtsson

+1

Lvulis avatar Apr 15 '21 01:04 Lvulis

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

zeehio avatar Mar 13 '22 14:03 zeehio