2

How to let more than one matrix to compose as one matrix

For example c = {{a, b}, {a, b}}; a = {{1, 0}, {0, 1}}; b = {{1, 1}, {1, 1}};

1 Answers1

4

You can use ArrayFlatten:

c = ArrayFlatten[{{a, b}, {a, b}}]

{{1, 0, 1, 1}, {0, 1, 1, 1}, {1, 0, 1, 1}, {0, 1, 1, 1}}

TeXForm @ MatrixForm @ c

$\left( \begin{array}{cccc} 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ \end{array} \right)$

kglr
  • 394,356
  • 18
  • 477
  • 896