Main Content

matlab.io.hdf4.sd.nameToIndex

Package: matlab.io.hdf4.sd

Index value of named data set

Syntax

idx = nameToIndex(sdID,sdsname)

Description

idx = nameToIndex(sdID,sdsname) returns the index of the data set with the name specified by sdsname. If there is more than one data set with the same name, the routine returns the index of the first one.

This function corresponds to the SDnametoindex function in the HDF C API.

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf','read');
idx = sd.nameToIndex(sdID,'temperature');
sd.close(sdID);

See Also