You are looking for the REPMAT function:
x = [1 2 2 3];
m = repmat(x,4,1);
You can also use indexing to repeat the rows:
m = x(ones(4,1),:);
or even outer-product:
m = ones(4,1)*x;
and also using BSXFUN:
m = bsxfun(@times, x, ones(4,1))
More Related Contents:
- How do I convert a 2X2 matrix to 4X4 matrix in MATLAB?
- Matlab: repeat every column sequentially n times [duplicate]
- How can I index a MATLAB array returned by a function without first assigning it to a local variable?
- How do you concatenate the rows of a matrix into a vector?
- How can I accumulate cells of different lengths into a matrix in MATLAB?
- How do I visualize a matrix with colors and values displayed?
- Use a vector as an index to a matrix
- Is MATLAB row specific or column major?
- How can I change the values of multiple points in a matrix?
- Construct adjacency matrix in MATLAB
- Replace specific columns in a matrix with a constant column vector
- How can I apply a function to every row/column of a matrix in MATLAB?
- How to select a submatrix (not in any particular pattern) in Matlab
- Multiply a 3D matrix with a 2D matrix
- How do I resize a matrix in MATLAB?
- Is there a substitute for blockproc in Matlab?
- Matrix “Zigzag” Reordering
- How do I compare all elements of two arrays?
- Sorting entire matrix according to one column in matlab
- How to subtract a vector from each row of a matrix? [duplicate]
- Index of max and min value in an array
- How can I sort a 2-D array in MATLAB with respect to one column?
- Does Matlab eig always returns sorted values?
- General method to find submatrix in matlab matrix
- MATLAB find and apply function to values of repeated indices
- the easiest way to convert matrix to one row vector [duplicate]
- Extract arbitrarily rotated plane of data from 3D array as 2D array
- How do I double the size of a vector in MATLAB with interpolation?
- MATLAB: Subtracting matrix subsets by specific rows
- Efficiently compute a 3D matrix of outer products – MATLAB