cumsum

Parent Previous Next

cumsum

y = cumsum ( x )
y = x.cumsum ( )

Cumulative sum

arg

type

Description

Unit or Value scale

x

SCAL

the array


Outputs

  • y is the cumulative sum of x.

Notes

  • If x is a matrix, y is a matrix of row-wise operations

Examples

  • [1 2 3 4 5].cumsum → [1 3 6 10 15]
  • (1:12).matrix(3).cumsum →
  • ans =
    1 3 6 10
    5 11 18 26
    9 19 30 42

See Also

diff | reshape

Created with the Personal Edition of HelpNDoc: Produce electronic books easily