MATLAB: Creation of matrices (24,72) M1&M2

72)matrices (24

Hello. I want to create matrices (24,72) that have the following forms:

Best Answer

You can use blkdiag:
C1 = repmat({[1,1,0]},1,24);
M1 = blkdiag(C1{:});
And the second is either:
M2 = circshift(M1,[0,1]);
or
C2 = repmat({[0,1,1]},1,24);
M2 = blkdiag(C2{:});