Given a 2D array of ones and zeros, generate an equivalent sized checkerboard array of ones and twos. The checkerboard pattern starts with 2:
[2,1,2,1,2; 1,2,1,2,1; 2,1,2,1,2];
Then set this checkerboard array to zero wherever the original was zero.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers31
Suggested Problems
-
Are all the three given point in the same line?
604 Solvers
-
Matrix with different incremental runs
589 Solvers
-
193 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
400 Solvers
-
Where is the number that you want to find?
94 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
You should add a test case where the last row and/or last column of x contains only zeroes.