matlab.io.hdf4.sd.refToIndex
Package: matlab.io.hdf4.sd
Index of data set corresponding to reference number
Syntax
idx = refToIndex(sdID,ref)
Description
idx = refToIndex(sdID,ref)
returns the
index of the data set identified by its reference number ref
.
The idx
output can then be passed to sd.select
,
to obtain a data set identifier.
This function corresponds to the SDreftoindex
function
in the HDF library C API.
Examples
import matlab.io.hdf4.* sdID = sd.start('sd.hdf','read'); idx = sd.nameToIndex(sdID,'temperature'); sdsID = sd.select(sdID,idx); ref = sd.idToRef(sdsID); idx2 = sd.refToIndex(sdID,ref); sd.endAccess(sdsID); sd.close(sdID);