This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
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))
|
2 | Pass |
%%
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))
|
960 Solvers
Change the sign of even index entries of the reversed vector
213 Solvers
Given a 4x4 matrix, swap the two middle columns
299 Solvers
394 Solvers
1244 Solvers