Cody

Solution 1173628

Submitted on 27 Apr 2017
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 = ones(4,4); y_correct = [1 0 0 0; 1 1 0 0; 1 1 1 0; 1 1 1 1]; assert(isequal(triangle(x),y_correct))

x = 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 x = 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 x = 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1

Output argument "ans" (and maybe others) not assigned during call to "triangle". Error in TestPoint1 (line 3) assert(isequal(triangle(x),y_correct))

2   Fail
x = ones(5,5); y_correct = [1 0 0 0 0; 1 1 0 0 0; 1 1 1 0 0; 1 1 1 1 0; 1 1 1 1 1]; assert(isequal(triangle(x),y_correct))

x = 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 x = 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1

Output argument "ans" (and maybe others) not assigned during call to "triangle". Error in TestPoint2 (line 3) assert(isequal(triangle(x),y_correct))

3   Fail
x = reshape(1:16,[4,4]); y_correct = [1 2 3 4; 0 6 7 8; 0 0 11 12; 0 0 0 16]'; assert(isequal(triangle(x),y_correct))

x = 1 5 9 13 0 6 10 14 3 7 11 15 4 8 12 16 x = 1 5 9 13 0 6 10 14 0 0 11 15 4 8 12 16 x = 1 5 9 13 0 6 10 14 0 0 11 15 0 0 0 16

Output argument "ans" (and maybe others) not assigned during call to "triangle". Error in TestPoint3 (line 3) assert(isequal(triangle(x),y_correct))

4   Fail
x = [0 1 2 3; 0 0 1 2; 0 0 0 1; 0 0 0 0]; y_correct = zeros(4); assert(isequal(triangle(x),y_correct))

x = 0 0 0 0 0 0 1 2 0 0 0 1 0 0 0 0 x = 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 x = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "ans" (and maybe others) not assigned during call to "triangle". Error in TestPoint4 (line 3) assert(isequal(triangle(x),y_correct))