UPC/1sem/octave/08/alph_entropy.m
2019-12-17 00:29:33 +07:00

4 lines
86 B
Mathematica

function [h] = alph_entropy(P);
P = P(P ~= 0);
h = -sum(P.*log2(P));
endfunction;