searching cell array of strings
Mostra commenti meno recenti
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?
Risposte (2)
Oleg Komarov
il 23 Ago 2011
0 voti
1 Commento
Jan
il 23 Ago 2011
And: find(strcmp(string, cellstring))
Fangjun Jiang
il 23 Ago 2011
Or maybe strfind(), regexp();
C = {'hello' 'yes' 'no' 'goodbye'};
S='ye';
Found=strfind(C,S);
Ind=~cellfun('isempty',Found);
C(Ind)
Categorie
Scopri di più su Characters and Strings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!