Main Content

matlab.io.hdf4.sd

Interact directly with HDF4 multifile scientific data set (SD) interface

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 package matlab.io.hdf4.sd. To use this package, prefix the function name with a package path, or use the import function to add the package 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 data set
matlab.io.hdf4.sd.getFilenameName of file
matlab.io.hdf4.sd.selectIdentifier of data set 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 data set
matlab.io.hdf4.sd.readDataRead subsample of data
matlab.io.hdf4.sd.setFillModeSet current fill mode of file
matlab.io.hdf4.sd.writeDataWrite to data set

Inquiry

matlab.io.hdf4.sd.fileInfoNumber of data sets and global attributes in file
matlab.io.hdf4.sd.getCompInfoInformation about data set compression
matlab.io.hdf4.sd.getFillValueFill value for data set
matlab.io.hdf4.sd.getInfoInformation about data set
matlab.io.hdf4.sd.idToRefReference number corresponding to data set identifier
matlab.io.hdf4.sd.idTypeType of object
matlab.io.hdf4.sd.isCoordVarDetermine if data set is a coordinate variable
matlab.io.hdf4.sd.isRecordDetermine if data set is appendable
matlab.io.hdf4.sd.nameToIndexIndex value of named data set
matlab.io.hdf4.sd.nameToIndicesList of data sets with same name
matlab.io.hdf4.sd.refToIndexIndex of data set 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.getCalData set calibration information
matlab.io.hdf4.sd.getDataStrsPredefined attributes for data set
matlab.io.hdf4.sd.getDimStrsPredefined attributes for dimension
matlab.io.hdf4.sd.getFillValueFill value for data set
matlab.io.hdf4.sd.getRangeMaximum and minimum range values
matlab.io.hdf4.sd.setCalSet data set calibration information
matlab.io.hdf4.sd.setDataStrsSet predefined attributes for data set
matlab.io.hdf4.sd.setDimStrsSet label, unit, and format attributes
matlab.io.hdf4.sd.setFillValueSet fill value for data set
matlab.io.hdf4.sd.setRangeSet maximum and minimum range value for data set

Chunking/Tiling Operations

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

Compression

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