MATLAB: Maximizing efficiency in simple commands

the simple stuff

I have an array given by
x = [1 2 3 4];
I would like to create a matrix that looks like
M = [1 2 3 4;
1 2 3 4;
1 2 3 4;
1 2 3 4];
What's the most computationally efficient way to create M from x?

Best Answer

x=[1 2 3 4];
M=repmat(x,4,1)