How reapeat a series in a matrix?

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2019-11-9
YourMatrix = zeros(6,120);
YourMatrix(1,:) = repmat(1:10, 1, 12);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by