Click or drag to resize

MatrixMathAverageT Method

Calculates the average value of all elements in the specified matrix.

Namespace: Altaxo.Calc.LinearAlgebra
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public static T Average<T>(
	IROMatrix<T> matrix
)
where T : struct, new(), INumber<T>

Parameters

matrix  IROMatrixT
The matrix whose elements are averaged. Must not be null.

Type Parameters

T
The numeric type of the matrix elements. Must be a value type that implements INumberTSelf.

Return Value

T
The average of all elements in the matrix, represented as type T.
Remarks
If the matrix contains no elements, this method will throw a divide-by-zero exception. The calculation uses checked arithmetic for the division.
See Also