MATLAB: Matrix manipulation, maybe repmat

MATLABmatrixmatrix manipulationrepmat

I have a huge matrix, just to make the case simple
Say I have a =
1 4 7 10
2 5 8 11
And I would like to get: a =
1 4 7 10
1 4 7 10
2 5 8 11
2 5 8 11
Is there a smart way of doing that(without loop)?
Thanks in advance!!

Best Answer

Dynamic version of the solution proposed by proecsm:
n = 2;
idx = repmat(1:size(a,1),n,1);
b = a(idx(:),:)
or
kron(A,ones(n,1))
or