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?

 채택된 답변

per isakson
per isakson 2012년 4월 28일

0 개 추천

Try the function, CUMSUM

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Types에 대해 자세히 알아보기

태그

질문:

2012년 4월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by