duration.cumsum
duration: CS = cumsum (D)
duration: CS = cumsum (D, dim)
duration: CS = cumsum (D, vecdim)
duration: CS = cumsum (D, 'all')
duration: CS = cumsum (…, direction)
duration: CS = cumsum (…, nanflag)
Compute the cumulative sum of the elements of a duration array.
This method overloads the core cumsum function for duration
arrays. The functionality is identical to core cumsum function.
Type help cumsum for more information.
Source Code: duration
cumsum returns the running total of the durations — a cumulative sum.
d = hours ([1, 2, 3, 4])
d =
1x4 duration array
1 hr 2 hr 3 hr 4 hr
cumsum (d)
ans =
1x4 duration array
1 hr 3 hr 6 hr 10 hr