Main Content

matlab.io.hdf4.sd.idToRef

Namespace: matlab.io.hdf4.sd

Reference number corresponding to dataset identifier

Syntax

ref = idToRef(sdsID)

Description

ref = idToRef(sdsID) returns the reference number corresponding to the dataset.

This function corresponds to the SDidtoref 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);
ref = sd.idToRef(sdsID);
sd.endAccess(sdsID);
sd.close(sdID);