MATLAB: Sum of rows in a defined rhythm

rhythmsum

Hello everyone,
i have the following array:
A(1:5*270,1)=1;
Now i would like to calculate the sum of every 270th Element. The new array is B. Every element will have the value 5 (1+1+1+1+1). Can someone tell me how i can do that?
The numbers are examples of course. In the original data there is one column with height of 5*270 and after 270 rows the numbers change.

Best Answer

A(1:5*270,1)=1;
B(1:270,1) = sum(A(270:270:end,1))