searching cell array of strings
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Fangjun Jiang
le 23 Août 2011
Or maybe strfind(), regexp();
C = {'hello' 'yes' 'no' 'goodbye'};
S='ye';
Found=strfind(C,S);
Ind=~cellfun('isempty',Found);
C(Ind)
0 commentaires
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!