cell operation
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
There is a cell array. A = {'ab', 'bc', 'cd'};
I'd like to get a new cell array, like: B = {'ab', 'ab', 'ab', 'bc', 'bc', 'bc', 'cd', 'cd', 'cd'}.
How to get this without using loop?
Thanks
0 commentaires
Réponse acceptée
Walter Roberson
le 28 Déc 2011
B = repmat(A, 3, 1); %do the duplication
B = B(:).' ; turn the result in to a row vector
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!