Main Content

matlab.io.hdf4.sd.dimInfo

Namespace: matlab.io.hdf4.sd

Information about dimension

Syntax

[name,dimlen,datatype,nattrs] = dimInfo(dimID)

Description

[name,dimlen,datatype,nattrs] = dimInfo(dimID) returns the name, length, data type, and number of attributes of the specified dimension.

This function corresponds to the SDdiminfo function in the HDF library C API.

Examples

Read a 2-by-3 portion of a dataset.

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
idx = sd.nameToIndex(sdID,'latitude');
sdsID = sd.select(sdID,idx);
dimID = sd.getDimID(sdsID,0);
[name,dimlen,datatype,nattrs] = sd.dimInfo(dimID);
sd.endAccess(sdsID);
sd.close(sdID);

See Also