Difference between revisions of "Unique Command"
From GeoGebra Manual
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact ) |
|||
Line 1: | Line 1: | ||
<noinclude>{{Manual Page|version=4.2}}</noinclude> | <noinclude>{{Manual Page|version=4.2}}</noinclude> | ||
{{command|cas=true|list}} | {{command|cas=true|list}} | ||
− | ;Unique[ <List | + | ;Unique[ <List> ] |
− | :Returns list of elements of 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. See also the [[Frequency Command|Frequency command]]. |
:{{example|1=<div> | :{{example|1=<div> | ||
:* <code><nowiki>Unique[{1, 2, 4, 1, 4}]</nowiki></code> yields ''{1, 2, 4}''. | :* <code><nowiki>Unique[{1, 2, 4, 1, 4}]</nowiki></code> yields ''{1, 2, 4}''. | ||
:* <code><nowiki>Unique[{"a", "b", "Hello", "Hello"}]</nowiki></code> yields ''{"'Hello", "a", "b"}''.</div>}} | :* <code><nowiki>Unique[{"a", "b", "Hello", "Hello"}]</nowiki></code> yields ''{"'Hello", "a", "b"}''.</div>}} | ||
==CAS Syntax== | ==CAS Syntax== | ||
− | ;Unique[ <List | + | ;Unique[ <List> ] |
− | :Returns a list where each element of | + | :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 10:31, 21 May 2013
- 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. See also the Frequency command.
- Example:
Unique[{1, 2, 4, 1, 4}]
yields {1, 2, 4}.Unique[{"a", "b", "Hello", "Hello"}]
yields {"'Hello", "a", "b"}.
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}.