Add only the positive numbers of x
example:
x = [-2 -1 0 1 2 3]
the positive numbers are: 1 2 3, so their sum is 6
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers96
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15821 Solvers
-
Compute a dot product of two vectors x and y
1057 Solvers
-
Sum of first n positive integers
630 Solvers
-
164 Solvers
-
201 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!