searching cell array of strings
24 ビュー (過去 30 日間)
古いコメントを表示
Is there a way to use the 'find' function or something like it to search a cell array of strings for a particular string and return it's location in the cell array?
0 件のコメント
回答 (2 件)
Fangjun Jiang
2011 年 8 月 23 日
Or maybe strfind(), regexp();
C = {'hello' 'yes' 'no' 'goodbye'};
S='ye';
Found=strfind(C,S);
Ind=~cellfun('isempty',Found);
C(Ind)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!