You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.MeanH Function
Stats Master VCL
ContentsIndex
PreviousUpNext
Statistics.MeanH Function

Harmonic mean.

Pascal
function MeanH(const Data: TVec): double;
Parameters 
Description 
Data 
Data. An exception is raised if Data is complex. 

the harmonic mean of given values.

Calculate the harmonic mean for given values.

Uses MtxExpr, Statistics, Math387;
procedure Example;
var a: Vector;
  MH : double;
begin
  a.SetIt(false,[2,3,5,4]);
  MH := MeanH(a); // MH = 3.11688311688312
end;
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector a;
  a.SetIt(false, OPENARRAY(double,(2,3,5,4)));
  double MH = MeanH(a);
  // MH = 3.11688311688312
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!