Easy HDF5 / NetCDF4 Matlab interface

Using HDF5 / NetCDF4 from any language can be intimidating if directly using the low-level API. 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.

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.

Examples

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