%% Remove Words from Documents by Index
% Remove words from documents by inputting a vector of numeric indices to removeWords.
% Create an array of tokenized documents.

documents = tokenizedDocument([
    "I love MATLAB"
    "I love MathWorks"])

%
% View the vocabulary of documents.

documents.Vocabulary

% Remove the first and third words of the vocabulary from the documents by specifying the numeric indices [1 3].

idx = [1 3];
newDocuments = removeWords(documents,idx)

% Alternatively, you can specify logical indices.

idx = logical([1 0 1 0]);
newDocuments = removeWords(documents,idx)

%
% Copyright 2012 The MathWorks, Inc.