Sum of rows in a defined rhythm
Show older comments
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.
6 Comments
Alex Mcaulley
on 27 May 2019
Do you mean
sum(A(270:270:end,1))
Max Bornemann
on 27 May 2019
Alex Mcaulley
on 27 May 2019
What's wrong with this?
A(1:5*270,1)=1;
B(1:270,1) = sum(A(270:270:end,1))
Max Bornemann
on 27 May 2019
Max Bornemann
on 27 May 2019
Alex Mcaulley
on 27 May 2019
Moved to answers :)
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!