Cody

Problem 43305. Sum positive elements of matrix.

Solution 1818721

Submitted on 17 May 2019
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   Fail
x = [-5 1 6; -5 5 -5; 4 9 2]; y_correct = 27; assert(isequal(your_fcn_name(x),y_correct))

y = 1 y = 6 y = 5 y = 4 y = 9 y = 2

Assertion failed.

2   Fail
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))

y = 2 y = 13 y = 5 y = 11 y = 10 y = 8 y = 7 y = 12 y = 4 y = 14 y = 15 y = 1

Assertion failed.