Difference between revisions of "Unique Command"
From GeoGebra Manual
m |
Noel Lambert (talk | contribs) |
||
Line 1: | Line 1: | ||
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|list}} | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|list}} | ||
− | ;Unique[ | + | ;Unique[ <List> ] |
:Returns list of elements of the given list in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text. | :Returns list of elements of the given list in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text. | ||
:{{examples|1=<div> | :{{examples|1=<div> | ||
Line 8: | Line 8: | ||
==CAS Syntax== | ==CAS Syntax== | ||
− | ;Unique[ | + | ;Unique[ <List> ] |
:Returns a list where each element of the given list occurs only once. | :Returns a list where each element of the given list occurs only once. | ||
:{{example|1=<div><code><nowiki>Unique[{1, x, x, 1, a}]</nowiki></code> yields ''{1, x, a}''. </div>}} | :{{example|1=<div><code><nowiki>Unique[{1, x, x, 1, a}]</nowiki></code> yields ''{1, x, a}''. </div>}} |
Revision as of 08:09, 23 August 2015
- Unique[ <List> ]
- Returns list of elements of the given list in ascending order, repetitive elements are included only once. Works for both a list of numbers and a list of text.
- Examples:
Unique[{1, 2, 4, 1, 4}]
yields {1, 2, 4}.Unique[{"a", "b", "Hello", "Hello"}]
yields {"'Hello", "a", "b"}.
Note: See also Frequency command.
CAS Syntax
- Unique[ <List> ]
- Returns a list where each element of the given list occurs only once.
- Example:
Unique[{1, x, x, 1, a}]
yields {1, x, a}.