Repeating Matrix Element Until N Times
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Dirga Eka Putra L
am 23 Sep. 2018
Kommentiert: Dirga Eka Putra L
am 23 Sep. 2018
Excuse me everyone, I want ask that how to repeating the matrix element like this example :
Example: y = [1; 2; 3; 4] and then I want the output like this (for example until N=7) :
Thanks
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 23 Sep. 2018
Just one of many possible ways...
L=length(y);
N=7;
x=repmat(y,ceil(N/L),1);
x=x(1:N);
Siehe auch
Kategorien
Mehr zu Creating and Concatenating 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!