Main Content

matlab.io.hdf4.sd.getDataStrs

Namespace: matlab.io.hdf4.sd

Predefined attributes for dataset

Syntax

[label,unit,format,coordsys] = getDataStrs(sdsID)
[label,unit,format,coordsys] = getDataStrs(sdsID,maxlen)

Description

[label,unit,format,coordsys] = getDataStrs(sdsID) returns the label, unit, format, and coordsys attributes for the dataset identified by sdsID.

[label,unit,format,coordsys] = getDataStrs(sdsID,maxlen) returns the label, unit, format, and coordsys attributes for the dataset identified by sdsID. The maxlen input is the maximum length of the attribute text. It defaults to 1000 if not specified.

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

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
idx = sd.nameToIndex(sdID,'temperature');
sdsID = sd.select(sdID,idx);
[label,unit,fmt,coordsys] = sd.getDataStrs(sdsID);
sd.endAccess(sdsID);
sd.close(sdID);