Thomas Cornish - MATLAB Cody - MATLAB Central

Thomas Cornish

74084
Rank
2
Badges
30
Score
1 – 4 of 4

Thomas Cornish received Solver badge for Solution 2182335

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
Go to top of page