Home > freetb4matlab > info-theory > entropy.m

entropy

PURPOSE ^

%

SYNOPSIS ^

function val=entropy(symprob,base)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} entropy (@var{symbol_probabilites}, @var{base})
%
% Computes the Shannon entropy of a discrete source whose
% probabilities are by @var{symbol_probabilities}, and optionally 
% @var{base} can be specified. Base of logarithm defaults to 2,
% when the entropy can be thought of as a measure of bits
% needed to represent any message of the source. For example
%
% @example
% @group
%          entropy([0.25 0.25 0.25 0.25]) @result{} ans = 2
%          entropy([0.25 0.25 0.25 0.25],4) @result{} ans = 1
% @end group
% @end example
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003