I have a vector and I want another vector of the same lenght having as values the sequential sum of the values of the first vector. Basically I want a series from vector values. Ideas?

 Accepted Answer

You want the cumulative sum?
x = 1:10
x = 1×10
1 2 3 4 5 6 7 8 9 10
y = cumsum(x)
y = 1×10
1 3 6 10 15 21 28 36 45 55

1 Comment

sorry for the stupid question, but thank youuu :)

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!