MATLAB: How reapeat a series in a matrix

matrix manipulationsequence

Hi, is one of my first tme that I use matlab. I'd like to know how can do if I have a matrix (6,120) and I want to fill the first row with a sequence of numbers from 1 to 10, that repeats until the end of the row.
Thankyou

Best Answer

YourMatrix = zeros(6,120);
YourMatrix(1,:) = repmat(1:10, 1, 12);