I'm trying to find the most frequent word in a list of words. Here is my code so far:
uniWords = unique(lower(words));
for i = 1:length(words)
for j = 1:length(uniWords)
if (uniWords(j) == lower(words(i)))
freq(j) = freq(j) + 1;
end
end
end
When I try to run the script, I get the following error:
Undefined function 'eq' for input arguments of
type 'cell'.
Error in Biweekly3 (line 106)
if (uniWords(j) == lower(words(i)))
Any help is appreciated!