Main Content

matlab.io.hdf4.sd.getInfo

Namespace: matlab.io.hdf4.sd

Information about dataset

Syntax

[name,dims,datatype,nattrs] = getInfo(sdsID)

Description

[name,dims,datatype,nattrs] = getInfo(sdsID) returns the name, extents, and number of attributes of the dataset identified by sdsID.

This function corresponds to the SDgetinfo function in the HDF library C API, but because MATLAB® uses FORTRAN-style ordering, the dims parameter is reversed with respect to the C library API.

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
idx = sd.nameToIndex(sdID,'temperature');
sdsID = sd.select(sdID,idx);
[name,dims,datatype,nattrs] = sd.getInfo(sdsID);
sd.endAccess(sdsID);
sd.close(sdID);