Group: | Matrix Manipulation |
Topic: | Sorting and Counting |
See also: | cumprod prod sum |
Function: | cumsum | |
Description: | cumsum computes the cumulative sum of the elements an array regarding a given dimension. |
Usage: | z = cumsum (x, j) | |
Input: | ||
x | array | |
j | integer (number of dimension, default = 1) | |
Output: | ||
z | array |
x=#(1,2,3)~#(3,4,5)~#(5,6,7) cumsum(x)
Contents of cumsum [1,] 1 3 5 [2,] 3 7 11 [3,] 6 12 18