Output a scalar that is equal to the sum of all positive elements in a given vector/matrix.
For Example:
The sum of all positive elements in [1 2 -4 -8] should be 3...
The sum of all positive elements in [1 2; 5 -6; 2 -10] should be 10...
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers48
Suggested Problems
-
Project Euler: Problem 1, Multiples of 3 and 5
3708 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2889 Solvers
-
Sum of diagonal of a square matrix
1640 Solvers
-
408 Solvers
-
631 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!