How can I find the common elements of 2 cell arrays of strings?
64 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 14 Avr 2014
Réponse apportée : MathWorks Support Team
le 14 Avr 2014
I have 2 cell arrays containing strings. I would like to find the elements that are common to both arrays and get their positions. Is there a function to do that?
Réponse acceptée
MathWorks Support Team
le 14 Avr 2014
Use the "intersect" function as follows:
>> [C,ia,ib] = intersect(A,B, 'stable');
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical 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!