Effacer les filtres
Effacer les filtres

Find how many times a word appeared in matrix

2 vues (au cours des 30 derniers jours)
Belal Abboushi
Belal Abboushi le 16 Fév 2015
Modifié(e) : Stephen23 le 16 Fév 2015
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)

Stephen23
Stephen23 le 16 Fév 2015
Modifié(e) : Stephen23 le 16 Fév 2015
A = {'anna','bob','cedric','diana','anna'};
B = 'anna';
N = sum(strcmp(A,B));

Catégories

En savoir plus sur Data Types 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!

Translated by