早教吧作业答案频道 -->英语-->
哈夫曼编码函数[dict,avglen]=huffmandict(symbols,p,N),symbols,p,N,variance这几个代表什么意思啊?
题目详情
哈夫曼编码函数[dict,avglen]=huffmandict(symbols,p,N),symbols,p,N,variance这几个代表什么意思啊?
▼优质解答
答案和解析
HUFFMANDICT Code dictionary generator for Huffman coder.
DICT = HUFFMANDICT(SYM,PROB) generates a binary Huffman code
dictionary using the maximum variance algorithm for the distinct
symbols given by the SYM vector.The symbols can be represented as a
numeric vector or single-dimensional alphanumeric cell array.The
second input,PROB,represents the probability of occurrence for each
of these symbols.SYM and PROB must be of same length.
DICT = HUFFMANDICT(SYM,PROB,N) generates an N-ary Huffman code
dictionary using the maximum variance algorithm.N is an integer
between 2 and 10 (inclusive) that must not exceed the number of
source symbols whose probabilities appear in PROB.
DICT = HUFFMANDICT(SYM,PROB,N,VARIANCE) generates an N-ary Huffman
code with the specified variance.The possible values for VARIANCE are
'min' and 'max'.
[DICT,AVGLEN] = HUFFMANDICT(...) returns the average codeword length
of the Huffman code.
For example:
symbols = [1:5] % Alphabet vector
prob = [.3 .3 .2 .1 .1] % Symbol probability vector
[dict,avglen] = huffmandict(symbols,prob)
% Pretty print the dictionary.
temp = dict;
for i = 1:length(temp)
temp{i,2} = num2str(temp{i,2});
end
temp
See also huffmanenco,huffmandeco.
Reference page in Help browser
doc huffmandict
DICT = HUFFMANDICT(SYM,PROB) generates a binary Huffman code
dictionary using the maximum variance algorithm for the distinct
symbols given by the SYM vector.The symbols can be represented as a
numeric vector or single-dimensional alphanumeric cell array.The
second input,PROB,represents the probability of occurrence for each
of these symbols.SYM and PROB must be of same length.
DICT = HUFFMANDICT(SYM,PROB,N) generates an N-ary Huffman code
dictionary using the maximum variance algorithm.N is an integer
between 2 and 10 (inclusive) that must not exceed the number of
source symbols whose probabilities appear in PROB.
DICT = HUFFMANDICT(SYM,PROB,N,VARIANCE) generates an N-ary Huffman
code with the specified variance.The possible values for VARIANCE are
'min' and 'max'.
[DICT,AVGLEN] = HUFFMANDICT(...) returns the average codeword length
of the Huffman code.
For example:
symbols = [1:5] % Alphabet vector
prob = [.3 .3 .2 .1 .1] % Symbol probability vector
[dict,avglen] = huffmandict(symbols,prob)
% Pretty print the dictionary.
temp = dict;
for i = 1:length(temp)
temp{i,2} = num2str(temp{i,2});
end
temp
See also huffmanenco,huffmandeco.
Reference page in Help browser
doc huffmandict
看了 哈夫曼编码函数[dict,a...的网友还看了以下:
已知Sn=2Sn-1+1,a1=1,求数列的通项公式前n想和Sn因为Sn-Sn-1=an所以Sn= 2020-04-07 …
“求所有的正整数n,使得n=d(n)².”这题中的d(n)是什么意思啊? 2020-04-09 …
一道奇怪的极限题lim1/n[(1-1/n)^2+(1-2/n)^2+...+(1-(n-1)/n 2020-05-14 …
表示n位的计算机计量范围是0~2^(n)-1,模=2^(n)啥意思啊计算机中的计量范围为啥是0~2 2020-05-17 …
[(-1)^n+1]*n+1/n这个事收敛还是发散啊?还有,我做这个的时候怎麼感觉x趋近于0啊?答 2020-05-19 …
信号与系统第一章,x[n]=cos(n/6),为什么它不是周期信号N/6=2πmN/m=π/3m= 2020-06-12 …
一阶分式递推,特征方程问题急用啊a(n+1)=(an)/(1+nan)我用特征方程做x=x/(1+ 2020-08-01 …
电力系统中的g是什么意思?x=0.14445lgDm/re(e是在r右下角的小e)+0.157/n 2020-08-03 …
高数上对通量的一点疑惑通量,定义是向量场F通过某一封闭曲线的流量.这个穿过,是垂直于平面穿过?还是从 2020-12-05 …
大学物理实验贝尔赛公式求标准差,高手帮忙啊!为什么公式中除的分母是(n-1),而不是n?,数据个数是 2021-01-01 …