Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > List Manipulation > Math & Counting Operations on Lists > Accumulate >
Mathematica > Data Manipulation > Handling Arrays of Data > Math & Counting Operations on Lists > Accumulate >
Mathematica > Data Manipulation > Image Processing & Analysis > Basic Image Manipulation > Handling Arrays of Data > Math & Counting Operations on Lists > Accumulate >

Accumulate

Accumulate[list]
gives a list of the successive accumulated totals of elements in list.
  • If list has length n, then Accumulate[list] will have the same length.
  • Accumulate[list, Method->"CompensatedSummation"] uses compensated summation to reduce numerical error in the result.
Cumulative sums:
Accumulate within columns:
Cumulative sums:
In[1]:=
Click for copyable input
Out[1]=
 
Accumulate within columns:
In[1]:=
Click for copyable input
Out[1]=
The head does not need to be List:
Triangular numbers:
Random walk:
Idealized random mountainside:
Cumulative sums of terms in a series:
Differences is almost the inverse of Accumulate:
Accumulate is equivalent to a particular case of FoldList:
Use Sum to symbolically accumulate sequences:
Diagonals of Pascal's triangle:
New in 6 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF