function e = tmentropy(P)
%
% tmentropy - Entropy measure of a cooccurrence matrix
% On input:
%     P: 2D cooccurrence matrix
% On output:
%     e: the entropy measure of P
% Call:
%     e = tmentropy(P);
%

is0 = P==0;
P2 = P+is0;
e = -(sum(sum(P2.*log(P2))));
