MATLAB: The question is how to get the following format

programming

Hi, I have a row, and I want to get a matrix by repeating this row as follow r=[ 1 2 3 4]
matrix=[ 1 2 3 4; 1 2 3 4; 1 2 3 4]

Best Answer

r=[ 1 2 3 4]
matrix=repmat(r,3,1)