cell operation
Show older comments
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
Accepted Answer
More Answers (1)
Jan
on 30 Dec 2011
A = {'ab', 'bc', 'cd'};
B = A(kron(1:3, ones(1,3)));
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!