DOCUMENTATION CENTER SEARCH
Mathematica
>
Elements of Lists
>
Built-in
Mathematica
Symbol
Selecting Parts of Expressions with Functions
Tutorials »
|
Cases
Take
Drop
Reap
Pick
MatchQ
StringMatchQ
See Also »
|
Conditionals
Elements of Lists
Functional Programming
Handling Arrays of Data
Language Overview
List Manipulation
Numerical Data
More About »
Select
Select
[
list
,
crit
]
picks out all elements
e
i
of
list
for which
crit
[
e
i
]
is
True
.
Select
[
list
,
crit
,
n
]
picks out the first
n
elements for which
crit
[
e
i
]
is
True
.
MORE INFORMATION
The object
list
can have any head, not necessarily
List
.
Select
can be used on
SparseArray
objects.
»
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Select elements that are even:
In[1]:=
Out[1]=
Use a pure function to test each element:
In[1]:=
Out[1]=
Return only the first expression selected:
In[1]:=
Out[1]=
Scope
(1)
Generalizations & Extensions
(2)
Applications
(7)
Properties & Relations
(1)
SEE ALSO
Cases
Take
Drop
Reap
Pick
MatchQ
StringMatchQ
TUTORIALS
Selecting Parts of Expressions with Functions
MORE ABOUT
Conditionals
Elements of Lists
Functional Programming
Handling Arrays of Data
Language Overview
List Manipulation
Numerical Data
RELATED LINKS
NKS|Online
(
A New Kind of Science
)
New in 1
© 2008 Wolfram Research, Inc.