This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Return information about HDF5 file


info = h5info(filename)
info = h5info(filename,location)
info = h5info(___,'TextEncoding',encoding)


info = h5info(filename) returns information about the entire HDF5 file, specified by filename.

info = h5info(filename,location) returns information about the group, data set, or named datatype specified by location in the HDF5 file, filename.

info = h5info(___,'TextEncoding',encoding) specifies the text encoding to use for reading objects in the HDF5 file.

Input Arguments


Character vector specifying the name of an HDF5 file.


Character vector specifying the location of a group, data set, or named datatype in an HDF5 file.


Character encoding, specified as 'system' or 'UTF-8'.

  • 'system' — Use the system default encoding for names of objects and attributes.

  • 'UTF-8' — Use UTF-8 encoding for names of objects and attributes.

Default: 'system'

Output Arguments


A structure containing information about the HDF5 file. The set of fields in the structure depends on the location parameter. The first field is always 'Filename'. Other fields that might be present in the info structure are as follows.

Location TypeFieldDescription
Files and Groups  
 NameCharacter vector specifying name of the group. If you specify only a file name, this value is '/'.
 GroupsArray of structures describing subgroups.
 DatasetsArray of structures describing data sets.
 DatatypesArray of structures describing named datatypes.
 LinksArray of structures describing soft, external, user-defined, and certain hard links.
 Attributes Array of structures describing group attributes.
Data sets 
 NameCharacter vector specifying the name of the data set.
 DatatypeStructure describing the datatype.
 DataspaceStructure describing the size of the dataset.
 ChunkSizeExtents of the data set's chunk size, if defined.
 FillValueData set's fill value, if defined.
 FilterArray of structures describing any defined filters such as compression.
 AttributesArray of structures describing data set attributes.
Named Datatypes 
 NameCharacter vector specifying the name of the datatype object.
 Class HDF5 class of the named datatype.
 TypeCharacter vector or struct further describing the datatype.
 SizeSize of the named datatype in bytes.


Return all information.

info = h5info('example.h5');

Return information about a group and all data sets contained within the group.

info = h5info('example.h5','/g4');

Return information about a specific dataset.

info = h5info('example.h5','/g4/time');

Introduced in R2011a

Was this topic helpful?