I have a square matrix say n by n; I want to expand this matrix to n^2 by n^2 such that values in the position are repeated.
e.g A matrix is
2 3
5 6
I want to generate matrix B such that
2 2 3 3
2 2 3 3
5 5 6 6
5 5 6 6
How can this be done in matlab? And need to be generalized for any square matrix
Additional question: If I want to duplicate like following
2 3 2 3
5 6 5 6
2 3 2 3
5 6 5 6
How this can be archived ?