This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x=ones(4);
y_correct = [2,1,2,1
1,2,1,2
2,1,2,1
1,2,1,2];
assert(isequal(a_1_2_checkerboard_where_true(x),y_correct))
2
1
2
1
1
2
1
2
2
1
2
1
1
2
1
2
|
2 | Pass |
x = ones(3,2);
y_correct = [2,1;1,2;2,1];
assert(isequal(a_1_2_checkerboard_where_true(x),y_correct))
2
1
1
2
2
1
|
3 | Pass |
y_correct = 2;
assert(isequal(a_1_2_checkerboard_where_true(1),y_correct))
2
|
4 | Pass |
x = [...
0,1,0,1,0;
1,1,1,1,1;
0,1,0,1,0;
1,1,1,1,1;
0,1,0,1,0];
y_correct = [0,1,0,1,0;
1,2,1,2,1;
0,1,0,1,0;
1,2,1,2,1;
0,1,0,1,0];
assert(isequal(a_1_2_checkerboard_where_true(x),y_correct))
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
|
5 | Pass |
x = ones(5,5); x(2:3,2:3)=0;
y_correct = [2,1,2,1,2;
1,0,0,2,1;
2,0,0,1,2;
1,2,1,2,1;
2,1,2,1,2];
assert(isequal(a_1_2_checkerboard_where_true(x),y_correct))
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
|
6 | Pass |
x=[1,1,0,0,0,0,0,0,0,1;
1,0,1,0,0,1,1,0,1,1;
1,0,1,0,1,1,1,1,1,1;
0,0,1,0,0,1,1,1,1,1;
0,1,0,0,0,0,0,0,1,1;
0,0,1,0,1,0,1,1,1,0;
1,1,1,0,0,0,0,1,0,0;
0,0,0,1,0,1,1,0,1,0;
1,0,1,1,0,0,0,0,1,0;
1,0,0,0,0,0,1,0,0,1];
y_correct = [2,1,0,0,0,0,0,0,0,1;
1,0,1,0,0,2,1,0,1,2;
2,0,2,0,2,1,2,1,2,1;
0,0,1,0,0,2,1,2,1,2;
0,1,0,0,0,0,0,0,2,1;
0,0,1,0,1,0,1,2,1,0;
2,1,2,0,0,0,0,1,0,0;
0,0,0,2,0,2,1,0,1,0;
2,0,2,1,0,0,0,0,2,0;
1,0,0,0,0,0,1,0,0,2];
assert(isequal(a_1_2_checkerboard_where_true(x),y_correct))
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
|
17121 Solvers
Back to basics 12 - Input Arguments
525 Solvers
Back to basics 20 - singleton dimensions
254 Solvers
Area of an equilateral triangle
2759 Solvers
Basic commands - Greatest common divisor
123 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!