【发布时间】:2013-11-08 23:18:35
【问题描述】:
我正在尝试在单词列表中查找最常用的单词。到目前为止,这是我的代码:
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
当我尝试运行脚本时,我收到以下错误:
Undefined function 'eq' for input arguments of
type 'cell'.
Error in Biweekly3 (line 106)
if (uniWords(j) == lower(words(i)))
感谢任何帮助!
【问题讨论】:
标签: string matlab compare cell-array