Cody

Problem 43305. Sum positive elements of matrix.

Solution 2329303

Submitted on 22 May 2020 by Laza Álmos
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = [-5 1 6; -5 5 -5; 4 9 2]; y_correct = 27; assert(isequal(your_fcn_name(x),y_correct))

row = 3 col = 3 y = 0 y = 1 y = 7 y = 12 y = 16 y = 25 y = 27

2   Pass
x = [ -2 2 -2 13; 5 11 10 8; -2 7 -2 12; 4 14 15 1]; y_correct = 102; assert(isequal(your_fcn_name(x),y_correct))

row = 4 col = 4 y = 0 y = 2 y = 15 y = 20 y = 31 y = 41 y = 49 y = 56 y = 68 y = 72 y = 86 y = 101 y = 102

Suggested Problems

More from this Author37

Community Treasure Hunt

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

Start Hunting!