我有一个矩阵作为
y = auto air condit freon articl hvx new cso uiuc edu tspila uxa cso uiuc edu tim spila romulan write articl apr ntuix ntu mgqlu ntuix ntu max write work ga solid adsorpt air con system for auto applic thi kind system energi for regener adsorb exhaust ga interest thi mail email follow thi thread discuss prospect thi technolog bite thi suppos work tim year ago demonstr cold air system us air call rovax unit work short come seal technolog todai<<大小(Y)
ans =
1 442此外,我还有另一个矩阵tokenVector作为
tokenVector = 第1至6列
'abandon' 'abomin' 'aborigin' 'abraham' 'abruptli' 'absenc'第7至13列
'absolut' 'absurd' 'abus' 'academi' 'acc' 'accept' 'accesori'当我使用ismember(y,tokenVector)时,我会得到一个错误:
"Cell contents reference from a non-cell array object".我不明白错误的含义。请帮帮忙,我是matlab的新手。
发布于 2014-02-26 14:19:53
我假设您的y只是一个字符串,即声明为
y = 'auto air condit freon ar...'在这种情况下,您只需要先调用strsplit将其拆分成单词的单元格矩阵:
ismember( strsplit(y,' '), tokenVector)该错误告诉您需要使用cell array作为输入,而不是简单的字符数组。strsplit函数将根据特定的分隔符(在本例中为空格' ' )将字符数组拆分为单元格数组。
https://stackoverflow.com/questions/22033285
复制相似问题