MATLAB: How to convert a large .mat file of (default format ~ 7) to a 7.3 MAT-file / HDF5 based format when the file is too large to load.

7.3 mat-file / hdf5 based formatconvertload

I have a program which exports .mat files in the default .mat format – I believe it v7 MAT-file? Due to the size I am unable to load the .mat file. When attempting to load the .mat file I receive an "Error using load. Cannot read file X". I have no control over the output of the program used to generate the .mat file. Is there a way in which the .mat file may be accessed to retrieve the content? Ideally I would like to retrieve the data and save it in a v7.3 MAT-file format. Thanks!

Best Answer

-v7 format .mat files cannot have any component which is larger than 2 gigabytes. This suggests a strategy of using load() to request particular variables from the -v7 .mat file, and write the contents to the -v7.3 .mat file (possibly using matFile)