how to do sum up elements one by one (sequence addition)

1 vue (au cours des 30 derniers jours)
vivek r
vivek r le 8 Jan 2017
[1 2 3 4] to [1 3 6 10] i.e 1=1 ; 1+2=3; 1+2+3=6; so on

Réponses (2)

halleyhit
halleyhit le 8 Jan 2017
just a hint: [1 3 6 10]'=[1 1 1 1;0 1 1 1; 0 0 1 1; 0 0 0 1]*[1 2 3 4]'

Roger Stafford
Roger Stafford le 9 Jan 2017
cumsum([1 2 3 4]) equals [1 3 6 10]

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by