Filter löschen
Filter löschen

How reapeat a series in a matrix?

2 Ansichten (letzte 30 Tage)
Enrico Azzini
Enrico Azzini am 9 Nov. 2019
Beantwortet: Walter Roberson am 9 Nov. 2019
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Nov. 2019
YourMatrix = zeros(6,120);
YourMatrix(1,:) = repmat(1:10, 1, 12);

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by