Main Content

matlab.io.hdf4.sd

Low-level access to HDF4 multifile scientific datasets (SD)

Description

To use these MATLAB® functions, you should be familiar with the HDF SD C API. In most cases, the syntax of the MATLAB function is similar to the syntax of the corresponding HDF library function. The functions are implemented as the namespace matlab.io.hdf4.sd. To use this namespace, prefix the function name with a namespace path, or use the import function to add the namespace to the current import list, prior to calling the function, for example,

import matlab.io.hdf4.*
sdID = sd.start("myfile.hdf","read");

Access

matlab.io.hdf4.sd.closeTerminate access to SD interface
matlab.io.hdf4.sd.endAccessTerminate access to dataset
matlab.io.hdf4.sd.getFilenameName of file
matlab.io.hdf4.sd.selectIdentifier of dataset with specified index
matlab.io.hdf4.sd.setExternalFileStore data in external file
matlab.io.hdf4.sd.startOpen HDF file and initialize SD interface

Read/Write

matlab.io.hdf4.sd.createCreate new dataset
matlab.io.hdf4.sd.readDataRead subsample of data
matlab.io.hdf4.sd.setFillModeSet current fill mode of file
matlab.io.hdf4.sd.writeDataWrite to dataset

Inquiry

matlab.io.hdf4.sd.fileInfoNumber of datasets and global attributes in file
matlab.io.hdf4.sd.getCompInfoInformation about dataset compression
matlab.io.hdf4.sd.getInfoInformation about dataset
matlab.io.hdf4.sd.idToRefReference number corresponding to dataset identifier
matlab.io.hdf4.sd.idTypeType of object
matlab.io.hdf4.sd.isCoordVarDetermine if dataset is a coordinate variable
matlab.io.hdf4.sd.isRecordDetermine if dataset is appendable
matlab.io.hdf4.sd.nameToIndexIndex value of named dataset
matlab.io.hdf4.sd.nameToIndicesList of datasets with same name
matlab.io.hdf4.sd.refToIndexIndex of dataset corresponding to reference number

Dimensions

matlab.io.hdf4.sd.dimInfoInformation about dimension
matlab.io.hdf4.sd.getDimIDDimension identifier
matlab.io.hdf4.sd.getDimScaleScale data for dimension
matlab.io.hdf4.sd.setDimNameAssociate name with dimension
matlab.io.hdf4.sd.setDimScaleSet scale values for dimension

User-defined Attributes

matlab.io.hdf4.sd.attrInfoInformation about attribute
matlab.io.hdf4.sd.findAttrIndex of specified attribute
matlab.io.hdf4.sd.readAttrRead attribute value
matlab.io.hdf4.sd.setAttrWrite attribute value

Predefined Attributes

matlab.io.hdf4.sd.getCalDataset calibration information
matlab.io.hdf4.sd.getDataStrsPredefined attributes for dataset
matlab.io.hdf4.sd.getDimStrsPredefined attributes for dimension
matlab.io.hdf4.sd.getFillValueFill value for dataset
matlab.io.hdf4.sd.getRangeMaximum and minimum range values
matlab.io.hdf4.sd.setCalSet dataset calibration information
matlab.io.hdf4.sd.setDataStrsSet predefined attributes for dataset
matlab.io.hdf4.sd.setDimStrsSet label, unit, and format attributes
matlab.io.hdf4.sd.setFillValueSet fill value for dataset
matlab.io.hdf4.sd.setRangeSet maximum and minimum range value for dataset

Chunking/Tiling Operations

matlab.io.hdf4.sd.getChunkInfoChunk size for dataset
matlab.io.hdf4.sd.readChunkRead chunk from dataset
matlab.io.hdf4.sd.setChunkSet chunk size and compression method of dataset
matlab.io.hdf4.sd.writeChunkWrite chunk to dataset

Compression

matlab.io.hdf4.sd.setCompressSet compression method of dataset
matlab.io.hdf4.sd.setNBitDataSetSpecify nonstandard bit length for dataset values