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!