searching cell array of strings
이전 댓글 표시
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?
답변 (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)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!