This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Cumulative sum


newfts = cumsum(oldfts)


newfts = cumsum(oldfts) calculates the cumulative sum of each individual time series data series in the financial time series object oldfts and returns the result in another financial time series object newfts. newfts contains the same data series names as oldfts.


collapse all

This example shows how to compute the cumulative sum for Disney stock and plot the results.

load disney.mat 
cs_dis = cumsum(fillts(dis));
title('Cumulative Sum for Disney')

Introduced before R2006a

Was this topic helpful?