Click or drag to resize

NMathFunctionsMedian(FloatVector) Method

Calculates the median value of a given vector's elements.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public static float Median(
	FloatVector v
)

Parameters

v  FloatVector
A vector.

Return Value

Single
The median value of the elements in v.
Exceptions
ExceptionCondition
InvalidArgumentException Thrown if v has zero length.
Remarks
The vector is sorted. If the vector has an odd number of elements the middle number is returned. Otherwise, the mean of the two middle numbers is returned.
See Also