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 visualización (últimos 30 días)
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?

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by