This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert scalar document to string vector


words = string(document)



words = string(document) converts a scalar tokenizedDocument to a string array of words.


collapse all

Convert a scalar tokenized document to a string array of words.

document = tokenizedDocument("an example of a short sentence")
document = 

   6 tokens: an example of a short sentence

words = string(document)
words = 1x6 string array
    "an"    "example"    "of"    "a"    "short"    "sentence"

Input Arguments

collapse all

Input document, specified as a scalar tokenizedDocument object.

Output Arguments

collapse all

Output words, returned as a string vector.

Introduced in R2017b