Main Content

matlab.io.hdf4.sd.nameToIndex

Namespace: matlab.io.hdf4.sd

Index value of named dataset

Syntax

idx = nameToIndex(sdID,sdsname)

Description

idx = nameToIndex(sdID,sdsname) returns the index of the dataset with the name specified by sdsname. If there is more than one dataset 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