Difference between revisions of "Take Command"
From GeoGebra Manual
Noel Lambert (talk | contribs) |
m (changed CAS syntax description) |
||
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}} | ||
− | ;Take[ | + | ;Take[ <List>, <Start Position> ] |
:Returns a list containing the elements from ''Start Position'' to the end of the initial list. | :Returns a list containing the elements from ''Start Position'' to the end of the initial list. | ||
:{{example| 1=<div><code><nowiki>Take[{2, 4, 3, 7, 4}, 3]</nowiki></code> yields ''{3, 7, 4}''.</div>}} | :{{example| 1=<div><code><nowiki>Take[{2, 4, 3, 7, 4}, 3]</nowiki></code> yields ''{3, 7, 4}''.</div>}} | ||
Line 6: | Line 6: | ||
:Returns a text containing the elements from ''Start Position'' to the end of the initial text. | :Returns a text containing the elements from ''Start Position'' to the end of the initial text. | ||
:{{example| 1=<div><code><nowiki>Take["GeoGebra", 3]</nowiki></code> yields the text ''oGebra''.</div>}} | :{{example| 1=<div><code><nowiki>Take["GeoGebra", 3]</nowiki></code> yields the text ''oGebra''.</div>}} | ||
− | ;Take[ | + | ;Take[ <List>, <Start Position>, <End Position> ] |
:Returns a list containing the elements from ''Start Position'' to ''End Position'' of the initial list. | :Returns a list containing the elements from ''Start Position'' to ''End Position'' of the initial list. | ||
:{{example| 1=<div><code><nowiki>Take[{2, 4, 3, 7, 4}, 3, 4]</nowiki></code> yields ''{3, 7}''.</div>}} | :{{example| 1=<div><code><nowiki>Take[{2, 4, 3, 7, 4}, 3, 4]</nowiki></code> yields ''{3, 7}''.</div>}} | ||
Line 12: | Line 12: | ||
:Returns a text containing the elements from ''Start Position'' to ''End Position'' of the initial text. | :Returns a text containing the elements from ''Start Position'' to ''End Position'' of the initial text. | ||
:{{example| 1=<div><code><nowiki>Take["GeoGebra", 3, 6]</nowiki></code> yields the text ''oGeb''.</div>}} | :{{example| 1=<div><code><nowiki>Take["GeoGebra", 3, 6]</nowiki></code> yields the text ''oGeb''.</div>}} | ||
− | ==CAS | + | |
− | + | {{hint|1= | |
− | + | In the [[File:Menu view cas.svg|link=|16px]] [[CAS View]] the input list can contain different types of objects: | |
:{{example| 1=<div><code><nowiki>Take[{1, 2, a, 4, 5}, 2, 4]</nowiki></code> yields ''{2, a, 4}''.</div>}} | :{{example| 1=<div><code><nowiki>Take[{1, 2, a, 4, 5}, 2, 4]</nowiki></code> yields ''{2, a, 4}''.</div>}} | ||
+ | }} |
Revision as of 14:09, 9 September 2015
- Take[ <List>, <Start Position> ]
- Returns a list containing the elements from Start Position to the end of the initial list.
- Example:
Take[{2, 4, 3, 7, 4}, 3]
yields {3, 7, 4}.
- Take[ <Text>, <Start Position> ]
- Returns a text containing the elements from Start Position to the end of the initial text.
- Example:
Take["GeoGebra", 3]
yields the text oGebra.
- Take[ <List>, <Start Position>, <End Position> ]
- Returns a list containing the elements from Start Position to End Position of the initial list.
- Example:
Take[{2, 4, 3, 7, 4}, 3, 4]
yields {3, 7}.
- Take[ <Text>, <Start Position>, <End Position> ]
- Returns a text containing the elements from Start Position to End Position of the initial text.
- Example:
Take["GeoGebra", 3, 6]
yields the text oGeb.
Hint: In the CAS View the input list can contain different types of objects:
- Example:
Take[{1, 2, a, 4, 5}, 2, 4]
yields {2, a, 4}.