Main Content
matlab.io.hdf4.sd.getDimID
Namespace: matlab.io.hdf4.sd
Dimension identifier
Syntax
dimID = getDimID(sdsID,dimnumber)
Description
dimID = getDimID(sdsID,dimnumber)
returns
the identifier of the dimension given its index.
Note
MATLAB® uses Fortran-style indexing while the HDF library
uses C-style indexing. The order of the dimension identifiers retrieved
with sd.getDimID
are reversed from what would be
retrieved via the C API.
This function corresponds to the SDgetdimid
function
in the HDF library C API.
Examples
Read an entire dataset.
import matlab.io.hdf4.* sdID = sd.start('sd.hdf'); idx = sd.nameToIndex(sdID,'temperature'); sdsID = sd.select(sdID,idx); dimID0 = sd.getDimID(sdsID,0); dimID1 = sd.getDimID(sdsID,1); sd.endAccess(sdsID); sd.close(sdID);