This solution is outdated. To rescore this solution, sign in.
-
5 Comments
Show
2 older comments
Sudheer Bhimireddy
on 5 Aug 2020
Where is the best solution?
Huaiyuan Chu
on 14 Aug 2020
function a = checkerboard(n)
t1 = ones(n,1) * (1:n);
t = t1 + t1';
a = bitget(t+1, 1);
end
Chris Liu
on 5 Nov 2020
function a = checkerboard(n)
a = zeros(n);
a(1:2:n,1:2:n)=1
a(2:2:n,2:2:n)=1
end
Suggested Problems
-
4356 Solvers
-
530 Solvers
-
624 Solvers
-
5358 Solvers
-
9596 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!