Repeating elements in a vector
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Furkan Sencer Kaçar
am 20 Okt. 2023
Kommentiert: Furkan Sencer Kaçar
am 20 Okt. 2023
Hi, i want my following vector:
A = [0,1; 1; 5; 10; 20]
to be
A = [0,1; 1; 5; 10; 20;0,1; 1; 5; 10; 20;0,1; 1; 5; 10; 20; ... ]
(50 times repeated)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
William Rose
am 20 Okt. 2023
A = [0,1; 1; 5; 10; 20]
is not valid because it uses a comma as well as semicolons. I assume you meant to write
A = [0; 1; 1; 5; 10; 20];
Then do
A=repmat(A,50,1);
Check:
size(A)
OK.
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!