Skip to content
Snippets Groups Projects
Commit 076491ba authored by marwan's avatar marwan
Browse files

changed from log2 to natural log

parent 494ab155
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,9 @@ function e=entropy(x)
% $Revision$
%
% $Log$
% Revision 2.1 2004/11/10 07:07:51 marwan
% initial import
%
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
......@@ -25,5 +28,5 @@ if nargout>1, error('Too many output arguments'), end
for j=1:size(x,2);
x(:,j)=x(:,j)./sum(x(:,j));
x2=x(find(x(:,j)),j);
e(:,j)=sum(-x2.*log2(x2));
e(:,j)=sum(-x2.*log(x2));
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment