Median: Double;
The Median property returns a median.
Sub Main;
Var
SQ: SmQPortions;
can: Array Of Double;
res: Integer;
m: Double;
Begin
can := New Double[16];
can[00] := 6209;
can[01] := 6385;
can[02] := 6752;
can[03] := 6837;
can[04] := 6495;
can[05] := 6907;
can[06] := 7349;
can[07] := 7213;
can[08] := 7061;
can[09] := 7180;
can[10] := 7132;
can[11] := 7137;
can[12] := 7473;
can[13] := 7722;
can[14] := 8088;
can[15] := 8516;
SQ := New SmQPortions.Create;
SQ.Samples := can;
res := SQ.Execute;
If res <> 0 Then
Debug.WriteLine(SQ.Errors);
Else
Debug.WriteLine("== Median ==");
m := SQ.Median;
Debug.WriteLine(m.ToString);
End If;
End Sub Main;
Executing this example shows the median value in the console window:
Module execution started
== Median ==
7132
Module execution finished
See also: