Filter löschen
Filter löschen

Find how many times a word appeared in matrix

2 Ansichten (letzte 30 Tage)
Belal Abboushi
Belal Abboushi am 16 Feb. 2015
Bearbeitet: Stephen23 am 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?

Antworten (1)

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

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by