How to coding Huffman Tree

3 visualizzazioni (ultimi 30 giorni)
Yagmur Tabak
Yagmur Tabak il 10 Mar 2021
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?

Risposte (0)

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!

Translated by