Repeating elements in a vector
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Furkan Sencer Kaçar
le 20 Oct 2023
Commenté : Furkan Sencer Kaçar
le 20 Oct 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 commentaires
Réponse acceptée
Plus de réponses (1)
William Rose
le 20 Oct 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.
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!