Skip to content

write_struct_to_hdf5.m

Basic Information

  SYNTAX:  write_struct_to_hdf5(file_name,hdf5_struct,hdf5_path)

  PURPOSE:
    Write a structure to an hdf5 file. Note that the only elements that
    are supported are strings, arrays (up to 2-D), and sub-structures.
    Structures are used to define groups in the output hdf5 file.
    Strings are stored as variable length strings (not attributes).

  INPUTS:
       file_name:      The filename to save the hdf5 file as.

       hdf5_struct:    The structure to be exported to hdf5 format.

       hdf5_path:      (optional - default='/') A path in the hdf5
                       file denoting the top-level group under which
                       all data is to be stored under. This function
                       is called recursively using this option to
                       denote moving into a lower group.

  OUTPUTS:
       None


  RESTRICTIONS:
       Note that the only elements that are supported are strings,
       arrays (up to 2-D), and sub-structures. Structures are used to
       define groups in the output hdf5 file. Strings are stored as
       variable length strings (not attributes).

       Currently breaks if trying to update a previously existing hdf5
       file and any elements overlap between the old and new data.

  WRITTEN BY:  Jayson Barr ON 10/11/18

  MODIFICATION HISTORY:

Dependencies