Problem 45484. Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x.
Examples: Input x = [1 2 3 4]
Output y is 6
Input x = [24 -1]
Output y is 24
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers76
Suggested Problems
-
Return the largest number that is adjacent to a zero
5413 Solvers
-
How to find the position of an element in a vector without using the find function
2750 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1894 Solvers
-
357 Solvers
-
815 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!