How to write the program for pick the first five element from an array than next five and store their individual sum in new array?
3 views (last 30 days)
Show older comments
How to write the program for pick the first five element from an array than next five and store their individual sum in new array?
0 Comments
Accepted Answer
David Hill
on 8 Jun 2022
a=randi(100,1,50);%an array
n=sum(reshape(a,5,[]));%sum of 5 elements placed in new array
0 Comments
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!