Package: matlab.io.hdf4.sd
Number of data sets and global attributes in file
[ndatasets,ngatts] = fileInfo(sdID)
[ndatasets,ngatts] = fileInfo(sdID) returns
the number of data sets ndatasets and the number
of global attributes ngatts in the file identified
by sdID.
ndatasets includes the number of coordinate
variable data sets.
This function corresponds to the SDfileinfo function
in the HDF library C API.
import matlab.io.hdf4.* sdID = sd.start('sd.hdf'); [ndatasets,ngatts] = sd.fileInfo(sdID); sd.close(sdID);