Why in the heck does this code work? It's just a cody problem for a checer board matrix. I figured it out with intuition, trial and error and dumb luck. Lucky too it didn't take too long. I understand the simple use of the colon operator when creating arrays but what happens when using the colon operator with iterations through matrix coordinates? What's going on under the hood hear?
function a = checboard(n)a=zeros(n);a(1:2:n,1:2:n)=1;a(2:2:n,2:2:n)=1;end