cell operation
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Walter Roberson
el 28 de Dic. de 2011
B = repmat(A, 3, 1); %do the duplication
B = B(:).' ; turn the result in to a row vector
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!