function I = checkerboard(w, n)
% Make a checkerboard with n squares in each column (and row), each wxw in size
blackstart = 0;
I = zeros(w*n, w*n);
for i = 0:(n-1)
    blackstart = ~blackstart;
    black = blackstart;
    for j = 0:(n-1)
        if ~black
            I((1+(w*i)):(w*(i+1)), (1+(w*j)):(w*(j+1))) = 1;
        end
        black = ~black;
    end
end