Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

cumsum

Computes the cumulative sum of the given arguments.

cumsum(x)

Just returns the given scalar, since the cumulative sum of one scalar is the scalar itself.

Argument x

Scalar

Returns 1. entry

Scalar

cumsum(m)

Computes the cumulative sum of a vector or a list of vectors, i.e. a matrix.

Argument m

Matrix

Returns 1. entry

Matrix

Example

cumsum([1, 2, 3, 0, 3, 2])

Returns the vector [1, 3, 6, 6, 9, 11], which is the cumulative sum of the given vector.

Clone this wiki locally