【发布时间】:2014-04-13 10:15:56
【问题描述】:
我有一个名为reducedWords (nx1) 的数组,该数组包含我文档中的单词。我需要找到高频词,我的问题是:有什么功能可以使用吗?还是应该定义我的函数?
reducedWords = allWords;
unneccesaryWords = {'in','on','at','from','with','a','as','if','of',...
'that','and','the','or','else','to','an'};
kk = 1;
while kk <= length(reducedWords)
for cc = 1:length(unneccesaryWords)
if strcmp(reducedWords{kk},unneccesaryWords{cc})==1
reducedWords = { reducedWords{1:kk-1} reducedWords{kk+1:end} };
kk = 1;
end
end
kk = kk + 1;
end
最好的问候
【问题讨论】:
-
你可以试试plotting a histogram。