Hello everybody.

`A=[1,2,3,4,5,6,7,8,9,10] % not a fixed size, can be build with n*5`

How can I build the sum of five numbers? I know how to do it, when the length of the vector is fixed:

a=sum(A(1:5),2)

b=sum(A(6:10),2)

Can you help me putting this operation into a for loop, so that I can do it on every size of the vector?

Tahnks.

## Best Answer