MATLAB: Create copies of each row of an array

matrix array

Is there a way to copy each row of an array one after another for example if I had
A =
1 2 3 4
5 6 7 8
how can I make it into
A =
1 2 3 4
1 2 3 4
5 6 7 8
5 6 7 8

Best Answer

kron(A,[1;1])
or
repelem(A,2,1)
Related Question