Main Content

Filters and Compression (H5Z)

Inline data filters, data compression


Use the MATLAB® HDF5 filters and compression interface, H5Z, to access information on filters in the local environment.



Determine if filter is available

output = H5Z.filter_avail(filterID) determines whether the filter specified by filterID is available to the application. filterID can be specified by one of the following character vectors or string scalars, or its numeric equivalent:








Information about filter

configFlags = H5Z.get_filter_info(filterID) retrieves information about the filter specified by its identifier. At present, the information returned is the filter's configuration flags, indicating whether the filter is configured to decode data, to encode data, neither, or both. configFlags should be used with these HDF5 constant values in a bitwise AND operation:

  • 'H5Z_FILTER_CONFIG_ENCODE_ENABLED' — Encoding is enabled for filter.

  • 'H5Z_FILTER_CONFIG_DECODE_ENABLED' — Decoding is enabled for filter.

  • 0 — Encoding and decoding functionalities are not available.

If the resulting value is 0, then the encode or decode functionality is not available.


expand all

Determine if the shuffle filter is available.

bool = H5Z.filter_avail('H5Z_FILTER_SHUFFLE');

Determine if encoding is enabled for the deflate filter.

flags = H5Z.get_filter_info('H5Z_FILTER_DEFLATE');
func = H5ML.get_constant_value('H5Z_FILTER_CONFIG_ENCODE_ENABLED');
enabled = bitand(flags,functionality) > 0;
Introduced before R2006a