Remove cells that contain only two or one character
古いコメントを表示
I have a variable that contain large cell arrays of strings but some of the cells contains strings that are meaningless such asç
xx = {'animal','a','aa','bc','dog','car','computer','screen','zx','tt','c','pen','ss'}
I would like to use regexp but I couldnt find appropriate expression to match two or single character.
Any sugguestion is highly appreciated.
Sami
採用された回答
その他の回答 (1 件)
Andrei Bobrov
2014 年 3 月 11 日
編集済み: Andrei Bobrov
2014 年 3 月 11 日
xx = {'animal','a','aa','bc','dog','car','computer','screen','zx','tt','c','pen','ss'}';
out = xx(cellfun(@numel,xx) <= 2)
:)
out = xx(cellfun(@numel,xx) > 2)
1 件のコメント
KnowledgeSeeker
2014 年 3 月 11 日
編集済み: KnowledgeSeeker
2014 年 3 月 11 日
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!