How to coding Huffman Tree
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
p = [0.10 0.20 0.10 0.25 0.35];
P = zeros(length(p)) ;
for i = 1: length (p)
for j = 1: length (p)
P (i, j) = p(i) * p(j);
end
p
end
for i=1:length(p)
entropy =-sum(p.* log2(p));
end
By writing a code like this, I obtained 25 super symbols and then calculated their probabilities.
then I calculated the entropy.
Now I have to create a huffman tree and find its mappings using the 25 super symbols I calculated.
I can do this with a simple for loop, but I can't get out of it.
can you help me?
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Large Files and Big Data in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!