MATLAB: Create a matrix (24,72) using ‘for’ loop.

creation and concatenation specific matrices using loops

How can I use the loop 'for' or other, to produce the same matrix (24,72) depicted in the figure? kind regards.

Best Answer

since it is a nice simple pattern of (zeros for columns that are a multiple of 3) then:
DesiredResult = ones(24,72);
DesiredResult(:,3:3:end)=0;