e.g I have the original matrix (m) looks like this one
1 2
3 4
Then I use n = padarray(m,[oldMatrixRow,OldMatrixColumn]); I will have
x x x x x x
x x x x x x
x x 1 2 x x
x x 3 4 x x
x x x x x x
x x x x x x
The point here is that I would want my new matrix look like this
1 2 1 2 1 2
3 4 3 4 3 4
1 2 1 2 1 2
3 4 3 4 3 4
1 2 1 2 1 2
3 4 3 4 3 4
Is there any smart way to do that ?
Thank you very much
You want
repmatwhere
Ais the matrix you want to repeat, andmandndefine the dimensions of how it is repeatedIn your case here, call your original matrix
Aand useto get your desired output