Main Content

matlab.io.hdf4.sd.attrInfo

Namespace: matlab.io.hdf4.sd

Information about attribute

Syntax

[name,datatype,nelts] = attrInfo(objID,idx)

Description

[name,datatype,nelts] = attrInfo(objID,idx) returns the name, data type, and number of elements in the specified attribute. The attribute is specified by its zero-based index value. objID can be either an SD interface identifier, a dataset identifier, or a dimension identifier.

This function corresponds to the SDattrinfo function in the HDF library C API.

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
idx = sd.findAttr(sdID,'creation_date');
[name,datatype,nelts] = sd.attrInfo(sdID,idx);
data = sd.readAttr(sdID,idx);
sd.close(sdID);

See Also