Problem 58613. Sum the two halves of an array with an even number of elements
given an array of an even number of elements, sum the front and back half of the array and return the sums as an array
For example:
x = [3, 5, 6, 7]
ans = sumHalfArrays(x)
ans = [8, 13];
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers30
Suggested Problems
-
Select every other element of a vector
31612 Solvers
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15380 Solvers
-
595 Solvers
-
412 Solvers
-
937 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!