Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
function E = entropy(d)
if ischar(d), d=abs(d); end;
[Y,I,J] = unique(d);
H = sparse(J,1,1);
p = full(H(H>0))/length(d);
E = -sum(p.*log2(p));
end;

View file

@ -0,0 +1,2 @@
> entropy('1223334444')
ans = 1.8464