I want to create k blocks with identical values in a n*n matrix (k can be divided exactly by the row number times the columns number as n*n ):
for example, when n = 4 and k = 4, (k can be divided exactly by 4*4=16), a matrix is create like this:
1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4
How can I do this without a for loop?