Why is it showing: Undefined function or variable 'removeStopWords'.

2 views (last 30 days)
Saugata Bose
Saugata Bose on 5 Nov 2018
Dear I am using R2017B with text analytics software installed(I have checked by searching get add-ons). I have written a simpole function which is following:
function x=test()
s='i am a boy and u r a grl';
disp(removeStopWords(s));
end
And it shows the following error:
Undefined function or variable 'removeStopWords'.
Would you please shed light on this issue explaining why is this happening?
Thanks,

Answers (2)

Walter Roberson
Walter Roberson on 5 Nov 2018
https://www.mathworks.com/help/textanalytics/ref/tokenizeddocument.removestopwords.html
Introduced in R2018b

madhan ravi
madhan ravi on 5 Nov 2018
Edited: madhan ravi on 5 Nov 2018
An example of the correct usage as documented
function x=test() %EDITED
s= tokenizedDocument([ 'i am a boy and u r a grl']);
disp(removeStopWords(s));
end
  11 Comments
Christopher Creutzig
Christopher Creutzig on 26 Nov 2018
removeStopWords does not work on strings or char vectors, only on tokenizedDocument.
The way MATLAB searches for functions means that it will only find removeStopWords if you have a tokenizedDocument in your workspace.
>> clear all
>> which removeStopWords
'removeStopWords' not found.
>> td = tokenizedDocument;
>> which removeStopWords
[..]/matlab/toolbox/textanalytics/textanalytics/tokenizedDocument.m % tokenizedDocument method

Sign in to comment.

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by