cumsum
Symbolic cumulative sum
Description
returns the cumulative sum ofB
= cumsum(A
)A
starting at the beginning of the first array dimension inA
whose size does not equal 1. The outputB
has the same size asA
.
If
A
is a vector, thencumsum(A)
returns a vector containing the cumulative sum of the elements ofA
.If
A
is a matrix, thencumsum(A)
returns a matrix containing the cumulative sums of each column ofA
.If
A
is a multidimensional array, thencumsum(A)
acts along thefirst nonsingleton dimension.