cell operation
18 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Walter Roberson
il 28 Dic 2011
B = repmat(A, 3, 1); %do the duplication
B = B(:).' ; turn the result in to a row vector
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!