Main Content

matlab.io.hdf4.sd.fileInfo

Namespace: matlab.io.hdf4.sd

Number of datasets and global attributes in file

Syntax

[ndatasets,ngatts] = fileInfo(sdID)

Description

[ndatasets,ngatts] = fileInfo(sdID) returns the number of datasets ndatasets and the number of global attributes ngatts in the file identified by sdID.

ndatasets includes the number of coordinate variable datasets.

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

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
[ndatasets,ngatts] = sd.fileInfo(sdID);
sd.close(sdID);

See Also