documents = tokenizedDocument([ ..."an example of a short sentence""a second short sentence"]);
bag = bagOfWords(documents);
newBag = removeLongWords(bag,7)
newBag =
bagOfWords with properties:
NumWords: 5
Counts: [2×5 double]
Vocabulary: ["an" "of" "a" "short" "second"]
NumDocuments: 2