clVector.Mean Method

Overload List

#SignatureDescription
1function Mean: Double;Mean value.
└ indexed: function Mean(Index: Integer; Len: Integer): Double;
2procedure Mean(out AMean: TCplx);Same as clVector.Meanc.
└ indexed: procedure Mean(out AMean: TCplx; Index: Integer; Len: Integer);
3procedure Mean(out AMean: Double; Index: Integer; Len: Integer);Calculate the mean value from calling object elements [Index]..[Index+Len-1].

Overload 1: function Mean: Double;

Mean value.

Returns: Double

Remarks:

Calculate the mean value of all calling object elements. The result is a real value. An exception is raised if calling object clVector.Complex property is true.

Examples
var a: clVector;
b: double;
begin
    a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
    b := a.Mean; // b = 2.5
end;
See Also: clVector.Sum, clVector.Meanc

Indexed: function Mean(Index: Integer; Len: Integer): Double;

Returns real mean value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1IndexIntegerstart index
2LenIntegerelement count

Returns: Double

Remarks:

An exception is raised if calling object clVector.Complex property is true or array borders are overrun.

Overload 2: procedure Mean(out AMean: TCplx);

#NameTypeDescription
1AMeanTCplxpre-computed mean

Result: stored in self (calling object)

Indexed: procedure Mean(out AMean: TCplx; Index: Integer; Len: Integer);

#NameTypeDescription
1AMeanTCplxpre-computed mean
2IndexIntegerstart index
3LenIntegerelement count

Result: stored in self (calling object)

Overload 3: procedure Mean(out AMean: Double; Index: Integer; Len: Integer);

Calculate the mean value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMeanDoublepre-computed mean
2IndexIntegerstart index
3LenIntegerelement count

Result: stored in self (calling object)

Remarks:

The result AMean is a real value. An exception is raised if calling object clVector.Complex property is true or array borders are overrun/underrun.