Suppose we have two square matrices "x" and "y" of dimension nxn and a numeric variable "a". I want to concatenate those matrices a number of times depending on the parameter "a", so to obtain a bigger square matrix "xy". This new matrix will contain only copies of the first two matrices arranged in the following way : matrix "x" on the main diagonal of the new matrix "xy" and matrix "y" in all other entries of the matrix "xy".
Here some example to clarify the question:
input: two 2x2 matrices
x=np.array([[1,1],[1,1]])
y=np.array([[2,2],[2,2]])
for a=2
expected output:
xy=np.array([[1,1,2,2],
[1,1,2,2],
[2,2,1,1],
[2,2,1,1]])
for a=3
expected output:
xy=np.array([[1,1,2,2,2,2],
[1,1,2,2,2,2],
[2,2,1,1,2,2],
[2,2,1,1,2,2],
[2,2,2,2,1,1],
[2,2,2,2,1,1]])`
what I'm looking for is a code for the generic case with a=n