array element sum wih condition

3 次查看(过去 30 天)
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?

采纳的回答

per isakson
per isakson 2012-4-28
Try the function, CUMSUM

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by