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?

1 次查看(过去 30 天)
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?

采纳的回答

David Hill
David Hill 2022-6-8
a=randi(100,1,50);%an array
n=sum(reshape(a,5,[]));%sum of 5 elements placed in new array

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by