Attribute (H5A)
Metadata associated with datasets or groups
Description
Use the MATLAB® HDF5 attribute interface, H5A
, to create, read, and write
dataset and group attributes, and access information about them.
An HDF5 attribute is a small metadata object that describes the nature and/or intended usage of a primary data object, which may be a dataset, group, or named datatype.
Functions
H5A.close
Close specified attribute
H5A.close(attrID)
terminates access to the attribute specified by
attrID
, releasing the identifier.
H5A.create
Create attribute
attrID = H5A.create(locID,attname,typeID,spaceID,acplID)
creates the
attribute with name attname
that is attached to the object specified by
locID
. This syntax corresponds to the H5Acreate
in
version 1.6 of the HDF5 C library.
attrID = H5A.create(locID,attname,typeID,spaceID,acplID,aaplID)
creates an attribute with the additional attribute access property list identifier
aaplID
. This syntax corresponds to the H5Acreate
in
version 1.8 of the HDF5 C library.
H5A.delete
Delete attribute
H5A.delete(locID,attname)
removes the attribute specified by
attname
from the dataset, group, or named datatype specified by
locID
.
H5A.get_info
Information about attribute
info = H5A.get_info(attrID)
returns information about an attribute
specified by attrID
.
H5A.get_name
Attribute name
attname = H5A.get_name(attrID)
returns the name of the attribute
specified by attrID
.
attname = H5A.get_name(attrID,'TextEncoding',encoding)
specifies the
text encoding to use to interpret the attribute name.
H5A.get_space
Copy of attribute dataspace
dspaceID = H5A.get_space(attrID)
returns a copy of the dataspace for
the attribute specified by attrID
.
H5A.get_type
Copy of attribute datatype
typeID = H5A.get_type(attrID)
returns a copy of the datatype for the
attribute specified by attrID
.
H5A.iterate
Execute function for attributes attached to object
H5A.iterate(locID,idx,fnc)
executes the specified function for each
attribute of the group, dataset, or named datatype specified by locID
.
This interface corresponds to H5Aiterate1
function in the HDF5 C
library.
[status,idxStop,cdataOut] =
H5A.iterate(objID,idxType,order,idxStart,fnc,cdataIn)
executes the specified
function fnc
for each attribute connected to an object. This interface
corresponds to H5Aiterate2
function in the HDF5 C library.
H5A.open
Open attribute
attrID = H5A.open(objID,attname)
opens an attribute for an object
specified by a parent object identifier objID
and attribute name
attname
.
attrID = H5A.open(objID,attname,aaplID)
opens an attribute with an
attribute access property list identifier aaplID
.
H5A.open_by_idx
Open attribute specified by index
attrID = H5A.open_by_idx(locID,objname,idxType,order,n)
opens an
existing attribute at index n
attached to an object specified by its
location, locID
, and name, objname
.
attrID = H5A.open_by_idx(locID,objname,idxType,order,n,aaplID,laplID)
opens an attribute with an attribute access property list identifier
aaplID
and link access property list identifier
laplID
.
H5A.open_by_name
Open attribute specified by name
attrID = H5A.open_by_name(locID,objname,attname)
opens an existing
attribute attached to an object specified by its location locID
and name
objname
.
attrID = H5A.open_by_name(locID,objname,attname,aaplID,laplID)
opens
an existing attribute with the attribute access property list identifier
aaplID
and link access property list identifier
laplID
.
H5A.read
Read attribute
attr = H5A.read(attrID)
reads the attribute specified by
attrID
. MATLAB will determine the appropriate memory datatype.
attr = H5A.read(attrID,memtypeID)
reads the attribute specified by
attrID
.
H5A.write
Write attribute
H5A.write(attrID,typeID,buf)
writes the data in the buffer
buf
into the attribute specified by attrID
using
memory datatype typeID
.
Examples
Version History
See Also
Dataset (H5D)
| File (H5F)
| Group (H5G)
| Identifier (H5I)
| Object (H5O)
| Property (H5P)
| Dataspace (H5S)
| Datatype (H5T)