I have a 500×1 cell aray and each row has a certain word in it. How can I count how many occurences of words there is and display it and also display the percentage of each occurence.
For example
The occurence of these words is:
Ans =
200 Green
200 Red
100 Blue
The percentage of these words:
Ans =
40% Green
40% Red
20% Blue
The idea is that strcmpi compares cell matrices elementwise. This can be used to compare the input names to the unique names in the input. Try the code below.
I leave the percentage calculation to you.