%Huffman, block size of 2 clear all, close all P = [.9 .05 .05]; P2 = kron(P,P); sym = 1:size(P2,2); H2 = sum( -P2.*log2(P2))/2; [DICT, AVGLEN] = huffmandict(sym,P2); ell = AVGLEN/2;