Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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

Example:
x=#(1,2,3)~#(3,4,5)~#(5,6,7)
cumsum(x)

Result:
Contents of cumsum
[1,]        1        3        5
[2,]        3        7       11
[3,]        6       12       18



(C) MD*TECH Method and Data Technologies, 05.02.2006