Create binary matrix in Matlab reporting increasing number of ones
问题 I would like your advise to write a Matlab code that creates a binary matrix A of size 31x5 such that the first row of A is [1 1 1 1 1] from the 2nd to the 6th of A we have 1 only once per row [1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1] from the 7th to the 16th row we have 1 twice per row [1 1 0 0 0 1 0 1 0 0 1 0 0 1 0 ...] from the 17th to the 26th row we have 1 three times per row from the 26th to the 31th row we have 1 four times per row I could that manually, but I would like to