Sum of elements in a vector (★) - MATLAB Cody - MATLAB Central

Problem 45827. Sum of elements in a vector (★)

Difficulty:Rate

(copy of Prob. 3)

Find the sum of all the numbers of the input vector x.

 Input  x = [1 2 3 5]
 Output y is 11

 Input  x = [42 -1]
 Output y is 41

Solution Stats

81.18% Correct | 18.82% Incorrect
Last Solution submitted on Mar 22, 2025

Solution Comments

Show comments
Who Deserves Your Praise? Discover the New Contribution Widget!
...
We are excited to announce another update to our Discussions area: the...

Problem Recent Solvers129

Suggested Problems

More from this Author52

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page