clMatrix.Mean Method

Overload List

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

Overload 1: function Mean: double; overload;

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 clMatrix.Complex property is true.

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

Indexed: function Mean(Index, Len: integer): double; overload;

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 clMatrix.Complex property is true or array borders are overrun.

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

#NameTypeDescription
1AMeanTCplxpre-computed mean

Result: stored in self (calling object)

Indexed: procedure Mean(out AMean: TCplx; Index, Len: integer); overload;

#NameTypeDescription
1AMeanTCplxpre-computed mean
2Indexintegerstart index
3Lenintegerelement count

Result: stored in self (calling object)

Overload 3: procedure Mean(out AMean: double; Index, Len: integer); overload;

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 clMatrix.Complex property is true or array borders are overrun/underrun.