Clear Filters
Clear Filters

array element sum wih condition

3 views (last 30 days)
Tomas
Tomas on 28 Apr 2012
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?

Accepted Answer

per isakson
per isakson on 28 Apr 2012
Try the function, CUMSUM

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!