Find how many times a word appeared in matrix
Afficher commentaires plus anciens
Hello, I'm trying to find out how many times a certain word appeared in a matrix. What command should i use?
Réponses (1)
A = {'anna','bob','cedric','diana','anna'};
B = 'anna';
N = sum(strcmp(A,B));
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!