function  hm = harmmean(data,dim)

%HARMMEAN -- Harmonic mean.
%
%  harmmean(data)     = 1./mean(1./data)
%  harmmean(data,dim) = 1./mean(1./data,dim)
%
%  Note that this implementation supersedes STATS/HARMMEAN.
%
%  See also MEAN, GEOMEAN, MEDIAN.

% Original coding by Alex Petrov, Ohio State University
% $Revision: 1.0 $  $Date: 2002/02/11 11:00 $
%
% Part of the utils toolbox version 1.1 for MATLAB version 5 and up.
% http://alexpetrov.com/softw/utils/
% Copyright (c) Alexander Petrov 1999-2006, http://alexpetrov.com
% Please read the LICENSE and NO WARRANTY statement in ../utils_license.m

if (nargin==1)
   hm = 1./mean(1./data) ;
else
   hm = 1./mean(1./data,dim) ;
end

%%  Return HM
%%%%%% End of file HARMMEAN.M
