Easy HDF5 Matlab interface

Using HDF5 from any language can be intimidating if directly using the low-level HDF5 API. HDF5 interfaces have sprung up for popular languages that Make HDF5 trivially easy to use, such as Python h5py. We have created several Matlab functions making HDF5 and NetCDF4 much easier to use in Matlab / GNU Octave.

The h5* functions are for HDF5, while the nc* functions are for NetCDF4. The functions are polymorphic, curating user data into classes acceptable for NetCDF4 and HDF5. Currently, GNU Octave only supports NetCDF4 via octave-netcdf while Matlab supports HDF5 and NetCDF4.


The h5* and nc* functions work very similarly. For simplicity, we only show the h5* functions.

  • h5save() save a variable to a file (this is the most used function–odd that Matlab does not have such a function from the factory)
  • h5variables() list all the variable in a file
  • h5size() get the size (shape) of a variable in a file
  • h5exists() check if a variable exists in a file