MatrixMathAverageT Method |
Calculates the average value of all elements in the specified matrix.
Namespace: Altaxo.Calc.LinearAlgebraAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntaxpublic 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
TThe average of all elements in the matrix, represented as type
T.
RemarksIf the matrix contains no elements, this method will throw a divide-by-zero exception. The
calculation uses checked arithmetic for the division.
See Also