Thomas Cornish
54170
54170
Rank2
2
Badges30
30
Score
1 – 4 of 4
Thomas CornishsubmittedSolution 2182335toProblem 4. Make a checkerboard matrix on 30 Mar 2020 |
Thomas CornishreceivedSolverbadge forSolution 2182335 on 30 Mar 2020 |
Thomas CornishreceivedCommenterbadge forProblem 4. Make a checkerboard matrix on 30 Mar 2020 |
Thomas Cornishsubmitted aCommenttoProblem 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