matlab.io.hdf4.sd.setCompress
Package: matlab.io.hdf4.sd
Set compression method of data set
Syntax
setCompress(sdsID,comptype,compparm)
Description
setCompress(sdsID,comptype,compparm)
sets
the compression scheme for the specified data set. The compression
must be done before writing the data set. Specify comptype
as
one of these values.
'none' | No compression |
'skphuff' | Skipping Huffman compression |
'deflate' | GZIP compression |
'rle' | Run-length encoding |
If
comptype
is'none'
or'rle'
, thencompparm
need not be specified.If
comptype
is'skphuff'
, thencompparm
is the skipping size.If
comptype
is'deflate'
, thencompparm
is the deflate level, which must be between 0 and 9.
This function corresponds to the SDsetcompress
function
in the HDF library C API.
Examples
import matlab.io.hdf4.* sdID = sd.start('myfile.hdf','create'); sdsID = sd.create(sdID,'temperature','double',[200 100]); sd.setCompress(sdsID,'deflate',5); data = rand(200,100); sd.writeData(sdsID,[0 0],data); sd.endAccess(sdsID); sd.close(sdID);