DOCUMENTATION CENTER SEARCH
Mathematica
>
Parts of Expressions
>
Built-in
Mathematica
Symbol
Manipulating Lists by Their Indices
Tutorials »
|
Part
Take
PadLeft
ReplacePart
See Also »
|
Elements of Lists
Evaluation Control
List Manipulation
Parts of Expressions
Parts of Matrices
More About »
Extract
Extract
[
expr
,
list
]
extracts the part of
expr
at the position specified by
list
.
Extract
[
expr
, {
list
1
,
list
2
,
...
}]
extracts a list of parts of
expr
.
Extract
[
expr
,
list
,
h
]
extracts parts of
expr
, wrapping each of them with head
h
before evaluation.
MORE INFORMATION
Extract
[
expr
, {
i
,
j
,
...
}]
is equivalent to
Part
[
expr
,
i
,
j
,
...
]
.
The position specifications used by
Extract
have the same form as those returned by
Position
, and used in functions such as
MapAt
and
ReplacePart
.
You can use
Extract
[
expr
,
...
,
Hold
]
to extract parts without evaluation.
If
expr
is a
SparseArray
object,
Extract
[
expr
,
...
]
extracts parts in the corresponding ordinary array.
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Extract the second part from an expression:
In[1]:=
Out[1]=
Extract a part nested in an expression:
In[1]:=
In[2]:=
Out[2]=
Extract parts from multiple positions:
In[3]:=
Out[3]=
Extract the parts given by
Position
:
In[1]:=
In[2]:=
Out[2]=
In[3]:=
Out[3]=
SEE ALSO
Part
Take
PadLeft
ReplacePart
TUTORIALS
Manipulating Lists by Their Indices
MORE ABOUT
Elements of Lists
Evaluation Control
List Manipulation
Parts of Expressions
Parts of Matrices
New in 3
© 2008 Wolfram Research, Inc.