I have a matrix M 4x4:

```
[[0. 1. 1. 2.]
 [1. 0. 2. 1.]
 [1. 2. 0. 1.]
 [2. 1. 1. 0.]]

```

And a matrix M1, M2 and M0 2x2, respectfully:

```
[[1. 0.]    [[2. 0.]    [[0. 0.]
 [0. 1.]]    [0. 2.]]    [0. 0.]]

```

Now, if M(i,j)==0 I want to put there M0, if M(i,j)==1 I want to put M1 and if M(i,j)==2, M2.
As a result I want to have matrix 8x8:

```
[[0. 0. 1. 0. 1. 0. 2. 0.]
 [0. 0. 0. 1. 0. 1. 0. 2.]
 [1. 0. 0. 0. 2. 0. 1. 0.]
 [0. 1. 0. 0. 0. 2. 0. 1.]
 [1. 0. 2. 0. 0. 0. 1. 0.]
 [0. 1. 0. 2. 0. 0. 0. 1.]
 [2. 0. 1. 0. 1. 0. 0. 0.]
 [0. 2. 0. 1. 0. 1. 0. 0.]]

```

Is there some smart way to do this,literally putting one matrix (M0,1,2) as an element of M? Or I have to create M=8x8 and put the numbers by hands?