Series of vector values

2 visualizzazioni (ultimi 30 giorni)
Nicolò Monaco
Nicolò Monaco il 15 Mar 2021
Commentato: Nicolò Monaco il 15 Mar 2021
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?

Risposta accettata

Steven Lord
Steven Lord il 15 Mar 2021
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 Commento
Nicolò Monaco
Nicolò Monaco il 15 Mar 2021
sorry for the stupid question, but thank youuu :)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by