array element sum wih condition

Hello,guys and girls, i have a situation:
F=[5, 4, 3, 2, 1];
I would like to sum matrix elements in order like this:
5
5+4
5+4+3
5+4+3+2
5+4+3+2+1
Do you have any ideas?

 Akzeptierte Antwort

per isakson
per isakson am 28 Apr. 2012

0 Stimmen

Try the function, CUMSUM

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by