文件名称:香农,霍夫曼编码
文件大小:36KB
文件格式:DOC
更新时间:2019-01-03 14:22:01
香农,霍夫曼
香农,霍夫曼编码,MATLABp=[0.4,0.3,0.1,0.09,0.07,0.04]; p=fliplr(sort(p)); [m,n]=size(p); for i=1:n B(i,1)=p(i); end a=sum(B(:,1))/2; for k=1:n-1 if abs(sum(B(1:k,1))-a)<=abs(sum(B(1:k+1,1))-a) break; end