【文件属性】:
文件名称:图像信息嫡计算
文件大小:346B
文件格式:M
更新时间:2016-06-01 14:45:54
嫡计算
嫡计算,
function h = entropys(p)
% H = ENTROPY(P) returns the entropy function of
% the probability vector p;
if length(find(p<0))~=0,
error('ERROR Not a prob. vector, negative component')
end
if abs(sum(p)-1)>10e-10,
error('ERROR Not a prob. vector, component do not add up to 1')
end
h = sum(-p.*log2(p));