Difference between revisions of "Unique Command"
From GeoGebra Manual
Line 3: | Line 3: | ||
;Unique[<List L>] | ;Unique[<List L>] | ||
:Returns list of elements of list L in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text. See also the [[Frequency Command|Frequency command]]. | :Returns list of elements of list L in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text. See also the [[Frequency Command|Frequency command]]. | ||
+ | : {{Example|1= | ||
+ | :* <code>Unique[{1, 2, 4, 1, 4}]</code> returns "{1, 2, 4}". | ||
+ | :* <code>Unique[{"a", "b", "Hello", "Hello"}]</code> returns ''{"Hello","a","b"}''.}} | ||
==CAS Syntax== | ==CAS Syntax== | ||
;Unique[<List L>] | ;Unique[<List L>] | ||
Line 8: | Line 11: | ||
: {{Example|1= | : {{Example|1= | ||
− | :* <code>Unique[{1, x, x, 1, a}]</code> | + | :* <code>Unique[{1, x, x, 1, a}]</code> returns "{x, 1, a}". }} |
Revision as of 11:35, 23 August 2011
- Unique[<List L>]
- Returns list of elements of list L in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text. See also the Frequency command.
- Example:
Unique[{1, 2, 4, 1, 4}]
returns "{1, 2, 4}".Unique[{"a", "b", "Hello", "Hello"}]
returns {"Hello","a","b"}.
CAS Syntax
- Unique[<List L>]
- Returns a list where each element of L occurs only once.
- Example:
Unique[{1, x, x, 1, a}]
returns "{x, 1, a}".