Thomas Cornish
74084
74084
Rank2
2
Badges30
30
Score1 – 4 of 4
Thomas Cornish submitted Solution 2182335 to Problem 4. Make a checkerboard matrix on 30 Mar 2020 |
Thomas Cornish received Solver badge for Solution 2182335 on 30 Mar 2020 |
Thomas Cornish received Commenter badge for Problem 4. Make a checkerboard matrix on 30 Mar 2020 |
Thomas Cornish submitted a Comment to Problem 4. Make a checkerboard matrix %% cherboard
function [board] = Chekerboard(n)
%% set bord matrix with zeros
board = zeros(n,n);
for j = 1:n
if mod(j,2)==0 %if zero row is even
for i =1:2:n
board(j,i) = 1;
end
else mod(j,2)==1 %if 1, row is odd
for t = 2:2:n
board(j,t) = 1;
end
end
end
on 30 Mar 2020 |
1 – 4 of 4