Difference between revisions of "Unique Command"

From GeoGebra Manual
Jump to: navigation, search
(command syntax: changed [ ] into ( ))
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.0}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|list}}
{{command|list}}
+
;Unique( &lt;List> )
;Unique[<List L>]
+
: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 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]].
+
:{{examples|1=<div>
: {{Example|1=&nbsp;
+
:* <code><nowiki>Unique({1, 2, 4, 1, 4})</nowiki></code> yields ''{1, 2, 4}''.  
:* <code>Unique[{1, 2, 4, 1, 4}]</code> returns "{1, 2, 4}".  
+
:* <code><nowiki>Unique({"a", "b", "Hello", "Hello"})</nowiki></code> yields ''{"'Hello", "a", "b"}''.</div>}}
:* <code>Unique[{"a", "b", "Hello", "Hello"}]</code> returns ''{"Hello","a","b"}''.}}
+
{{Note|1=See also [[Frequency Command|Frequency command]].}}
 +
 
 
==CAS Syntax==
 
==CAS Syntax==
;Unique[<List L>]
+
;Unique( &lt;List> )
:Returns a list where each element of L 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=&nbsp;
 
:* <code>Unique[{1, x, x, 1, a}]</code> returns "{1, x, a}". }}
 

Latest revision as of 11:59, 6 October 2017


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}.
© 2024 International GeoGebra Institute