MATLAB: Creating a matrix by expanding a row

MATLABmatrix

Suppose I have a 1*N row vector A. I want to vertically concatenate A for M times to create M*N matrix. Please advise.

Best Answer

You can use repmat() to repeat a matrix several times. In your case you can use

repmat(A, m, 1)