cell operation
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2011 年 12 月 28 日
B = repmat(A, 3, 1); %do the duplication
B = B(:).' ; turn the result in to a row vector
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!