Accumulate

Accumulate[list]

gives a list of the successive accumulated totals of elements in list.

Details and Options

  • If list has length n, then Accumulate[list] will have the same length.
  • Accumulate[list] is effectively equivalent to Rest[FoldList[Plus,0,list]].
  • Accumulate[list,Method->"CompensatedSummation"] uses compensated summation to reduce numerical error in the result.

Examples

open allclose all

Basic Examples  (2)

Cumulative sums:

In[1]:=
Click for copyable input
Out[1]=

Accumulate within columns:

In[1]:=
Click for copyable input
Out[1]=

Scope  (3)

Generalizations & Extensions  (1)

Applications  (4)

Properties & Relations  (3)

Possible Issues  (1)

Neat Examples  (1)

See Also

FoldList  Differences  Total  Sum  Plus  MovingAverage  LinearRecurrence

Introduced in 2007
(6.0)
| Updated in 2008
(7.0)