Asked by Rs verma
on 5 Apr 2014

hey everyone , i am new to matlab and i want to implement huffman coding algorithm in which input will be symbols and frequencies , also frequencies must not be between 0-1 ,can be any positive integer. I found some functions like

[dist avgvalue] = huffmandict(symbols,p);

but it takes only probability vector that must be 0 to 1 also the sum of all probabilities should be 1 here, but in my case p can be any positive integer. example:

symbol frequencies 1 3 2 9 11 10 0 0

and so on

please provide some help thanks in advance

*No products are associated with this question.*

Answer by Walter Roberson
on 5 Apr 2014

Accepted answer

the experimental probability for any given symbol is the frequency for it divided by the total of the frequencies.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments