This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

h5readatt

Read attribute from HDF5 file

Syntax

attval = h5readatt(filename,location,attr)

Description

attval = h5readatt(filename,location,attr) retrieves the value for the named attribute attr from the given location in the HDF5 file filename.

Input Arguments

filename

Character vector or string scalar specifying the name of an HDF5 file.

location

Character vector or string scalar specifying the full path of the attribute in an HDF5 file. location can refer to either a group or a data set.

attr

Character vector or string scalar specifying the name of an attribute in an HDF5 file.

Output Arguments

attval

Value of the attribute.

Examples

collapse all

attval = h5readatt('example.h5','/','attr2')
attval = 2x2 int32 matrix

   0   2
   1   3

Read the units attribute.

attval = h5readatt('example.h5','/g4/lon','units')
attval = 
'degrees_east'

Introduced in R2011a