摘要:
huffman.mfunction [h,l]=huffman(p)if (length(find(p<0))~=0) error('Not a prob,negative component'); end if (abs(sum(p)-1)>10e-10) error('Not a prob.vector,component do not add to 1') end n=length(p); q=p; m=zeros(n-1,n); for i=1:n-1 [q,l]=sort(q); m(i,:)=[l(1:n-i+1),zeros(1,i-1 阅读全文