Find in Array of Strings
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how do i find the row number for 'STG' in the following array of names as: 'asf' 'poif' 'STG' 'iam' 'no'
0 commentaires
Réponse acceptée
Matt Fig
le 28 Juin 2011
Is your array a cell array or a character array? If it is a cell array,
A = {'asf'
'poif'
'STG'
'iam'
'no'}
strmatch('STG',A)
Or you can use:
find(strcmp(A,'STG'))
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur String Parsing 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!