Home > freetb4matlab > info-theory > laverage.m

laverage

PURPOSE ^

%

SYNOPSIS ^

function Lavg=laverage(codebook,problist)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {@var{avgbits} =} laverage (@var{codebook}, @var{problist})
%
% Compute the average word length @code{SUM(@var{i} = 1:@var{N})* Li * Pi}
% where codebook is a struct of strings, where each
% string represents the codeword. Problist is the 
% probability values. For example
% 
% @example
% @group
%      x = @{'0','111','1110'@}; p=[0.1 0.5 0.4];
%      laverage(x, p) @result{} ans = 3.2000
% @end group
% @end example
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003