DOCUMENTATION CENTER SEARCH
Mathematica
>
Assignments
>
Built-in
Mathematica
Symbol
Special Forms of Assignment
Tutorials »
|
Append
PrependTo
Sow
See Also »
|
Assignments
Constructing Lists
Elements of Lists
Procedural Programming
Rearranging & Restructuring Lists
More About »
AppendTo
AppendTo
[
s
,
elem
]
appends
elem
to the value of
s
, and resets
s
to the result.
MORE INFORMATION
AppendTo
[
s
,
elem
]
is equivalent to
s
=
Append
[
s
,
elem
]
.
AppendTo
[
s
,
elem
]
does not evaluate
s
.
You can use
AppendTo
repeatedly to build up a list, though
Sow
and
Reap
will usually be more efficient.
»
AppendTo
works on
SparseArray
objects, returning ordinary lists if necessary.
»
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Assign
l
to a list:
In[1]:=
Out[1]=
Include a new value at the end of the list:
In[2]:=
Out[2]=
The value assigned to
l
has changed:
In[3]:=
Out[3]=
Generalizations & Extensions
(2)
Applications
(1)
Possible Issues
(4)
SEE ALSO
Append
PrependTo
Sow
TUTORIALS
Special Forms of Assignment
MORE ABOUT
Assignments
Constructing Lists
Elements of Lists
Procedural Programming
Rearranging & Restructuring Lists
New in 1
© 2008 Wolfram Research, Inc.