repeating elements of a vector in a certain manner
Afficher commentaires plus anciens
Hello all, I have a vector A of length n. I would like to create a new vector B which contains each element of A repeated m times; i.e. length of B is mxn. For example, let A=[2 4 5 7 8]; m=3; then, B=[2 2 2 4 4 4 5 5 5 7 7 7 8 8 8]; What is the fastest way of doing that? Thanks!
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Help and Support dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!