# How to stack multiple matrices?

I have a matrix 'mat' and I would like to stack it k times

$$\begin{pmatrix} mat \\ mat \\ mat \\ mat \\ mat \\ \vdots \end{pmatrix}$$

such that the result is also a matrix. I tried Join and ArrayFlatten but it did not seem to work. Especially the fact that k is supposed to stay arbitrary makes it really difficult for me.

mat = Array[a, {3, 3}];

k = 5;
stacked = ArrayFlatten[ConstantArray[{mat}, k]]

Row[MatrixForm /@ {mat, stacked}, Spacer[10]]

Alternatively,

Array[mat &, k, 1, Join] ==
Join @@ ConstantArray[mat, k] ==
Flatten[ConstantArray[mat, k], 1] ==
ArrayFlatten[ConstantArray[mat, k], 1] ==
stacked

True

Using the same mat and k as those in @kglr 's post, here is another option:

KroneckerProduct[ConstantArray[1, k], mat]