PRODUCTS
PURCHASE
FOR USERS
COMPANY
OUR SITES
DOCUMENTATION CENTER SEARCH
Mathematica
>
Elements of Lists
>
Built-in
Mathematica
Symbol
Constructing Lists
Tutorials »
|
Cases
Part
Position
Boole
ListConvolve
Select
See Also »
|
Conditionals
Elements of Lists
More About »
Pick
Pick
[
list
,
sel
]
picks out those elements of
list
for which the corresponding element of
sel
is
True
.
Pick
[
list
,
sel
,
patt
]
picks out those elements of
list
for which the corresponding element of
sel
matches
patt
.
MORE INFORMATION
sel
can be a nested list of any depth.
Pick
[
list
,
sel
,
patt
]
picks out those
list
[[
i
1
,
i
2
,
...
]]
for which
sel
[[
i
1
,
i
2
,
...
]]
matches
patt
.
Depending on the arrangement of elements matching
patt
in a nested list
sel
,
Pick
may return a ragged array.
The heads in
list
and
sel
do not have to be
List
.
Pick
works with
SparseArray
objects.
EXAMPLES
CLOSE ALL
Basic Examples
(2)
Pick out elements wherever a 1 appears in the "selector" list:
In[1]:=
Out[1]=
Pick out elements from a 2D array:
In[1]:=
Out[1]=
Scope
(1)
Generalizations & Extensions
(1)
Possible Issues
(1)
SEE ALSO
Cases
Part
Position
Boole
ListConvolve
Select
TUTORIALS
Constructing Lists
MORE ABOUT
Conditionals
Elements of Lists
New in 5.1
© 2008 Wolfram Research, Inc.