Main Content

matlab.io.hdf4.sd.setFillValue

Namespace: matlab.io.hdf4.sd

Set fill value for dataset

Syntax

setFillValue(sdsID,fillValue)

Description

setFillValue(sdsID,fillValue) sets the fill value for a dataset. The fill value must have the same data type as the dataset.

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

Examples

import matlab.io.hdf4.*
sdID = sd.start('myfile.hdf','create');
sdsID = sd.create(sdID,'temperature','double',[10 20]);
sd.setFillValue(sdsID,-999);
sd.endAccess(sdsID);
sd.close(sdID);