huffman

A set of MATLAB m-files (version 5.2) which do complete Huffman Coding.
13.8K Downloads
Updated 8 Feb 1998

No License

A set of MATLAB m-files (version 5.2) which do complete Huffman Coding.


The files are:

hufflen: Based on probability (or number of occurences) of each symbol the length for the Huffman codewords are calculated.

ex: HL = hufflen(S);


huffcode: Based on the codeword lengths this function find the Huffman codewords

ex: HK = huffcode(HL);


hufftree: Make the Huffman-tree from the length of Huffman codes

ex: Htree = hufftree(HL);


huff03: Huffman encoder/decoder, one or two vectors of non-negative integers are huffman coded.

ex: y = huff03(x1, x2); % encoding
ex: [x1, x2] = huff03(y); % decoding

Cite As

Karl Skretting (2026). huffman (https://uk.mathworks.com/matlabcentral/fileexchange/228-huffman), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0.0