documents = tokenizedDocument([ ..."an example of a short sentence""a second short sentence""a third example""a final sentence"]);
bag = bagOfWords(documents)
bag =
bagOfWords with properties:
NumWords: 9
Counts: [4×9 double]
Vocabulary: ["an" "example" "of" "a" "short" "sentence" "second" "third" "final"]
NumDocuments: 4