CUMULATIVE SUM – [CUMSUM]
Outputs the cumulative sum of input over time.
CATEGORY
Mathematical
DESCRIPTION
Outputs the cumulative sum of input over time.
RESULT VARIABLES AND PARAMETERS
Result | Cumulative sum |
Signal | Input |
SYNTAX
res=cumsum(input)
CHARACTERISTICS
Data type support
Double Floating point
EXAMPLE
In the below example, a signal of constant value of 1 is given as input to the function cumsum. The sampling frequency is set at 20000 samples/second. Thus, in a duration of 0.1 second, there will be 2000 sample points. Thus, output of the function is the sum of 1 over each sampling period. At the end of 0.1 second, the output value will be 2000.