Azzera filtri
Azzera filtri

Find how many times a word appeared in matrix

2 visualizzazioni (ultimi 30 giorni)
Belal Abboushi
Belal Abboushi il 16 Feb 2015
Modificato: Stephen23 il 16 Feb 2015
Hello, I'm trying to find out how many times a certain word appeared in a matrix. What command should i use?

Risposte (1)

Stephen23
Stephen23 il 16 Feb 2015
Modificato: Stephen23 il 16 Feb 2015
A = {'anna','bob','cedric','diana','anna'};
B = 'anna';
N = sum(strcmp(A,B));

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by