procedure Unique(const Src: TMtxVec; const Dst: TVec; const Counts: TVecInt);
Finds the unique elements in vector/matrix.
| # | Name | Description |
|---|---|---|
| 1 | Src | Defines data unique elements search. |
| 2 | Dst | Returns unique elements. Size and TMtxVec.Complex properties of Dst are adjusted automatically. |
| 3 | Counts | If specifed, stores the count of each unique element in dataset. |
Result: stored in self (calling object)
Remarks:
Finds and sorts the unique elements in Src vector/matrix array. Sorted values are returned in Dst vector. An exception is raised if Src is Complex. Length and Complex properties of Dst vector are adjusted automatically.
Examples
Uses MtxExpr, Statistics;
procedure Example;
var m1: Matrix;
uvec: Vector;
begin
m1.SetIt(4,3,false,
[ 1,2,3,
4,2,1,
3,2,3,
3,3,1]);
Unique(m1,uvec);
// uvec elements are [1,2,3,4]
end;
See Also: Statistics.Ranks, Statistics.TiedRanks