MATLAB Answers

Rs verma

Huffman coding with frequencies

Asked by Rs verma
on 5 Apr 2014
Latest activity Commented on 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.

1 Answer

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.

  1 Comment

Rs verma
on 5 Apr 2014

thanks walter

Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!