How can I get Matlab to check for a specific string and show it's location?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Surafel Taddesse
le 10 Juil 2019
Modifié(e) : Geoff Hayes
le 11 Juil 2019
Lets say I have the following:
A = [a1,a2,a3,a11,a22,a33]
When I say
Index = strfind(A,'a1')
Matlab tells me that there are 2 a1 because it considers the a11 as well. Same for a2 or a3.
How can I specify that I want a1 only.
I appriciate the help.
0 commentaires
Réponse acceptée
Geoff Hayes
le 11 Juil 2019
>> A = {'a1','a2','a3','a11','a22','a33'};
>> result = strcmp(A,'a1')
result =
1 0 0 0 0 0
0 commentaires
Plus de réponses (0)
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!