MATLAB: How to create a matrix of N columns formed by just one vector

columnsconcatenationMATLAB

Hi! If I have a vector like (5 8 7 9 8 4 7)' how can I create a matrix of N (for example 1000) columns formed by this vector? Thank you!

Best Answer

for a row vector concatenated vertically:
A=repmat(vector,[1000 1]);
for a column vector concatenated horizontally:
A=repmat(vector,[1 1000]);