str = 1x5 string
"Li"
"Sanchez"
"Jones"
"Yang"
"Larson"
In fact, the string function converts any cell array, so long as all of the contents can be converted to
strings.
C2 = {5, 10, 'some text', datetime('today')}
C2=1×4 cell array
{[5]}
{[10]}
{'some text'}
{[01-Sep-2021]}
str2 = string(C2)
str2 = 1x4 string
"5"
"10"
"some text"
"01-Sep-2021"
See Also
cellstr | char | iscellstr | strcmp | string
More About
•
“Text in String and Character Arrays” on page 6-2
•
“Access Data in Cell Array” on page 12-5
•
“Create String Arrays” on page 6-5
•
“Update Your Code to Accept Strings” on page 6-64
•
“Frequently Asked Questions About String Arrays” on page 6-59
6 Characters and Strings
6-14
Précédent

- 196/1450

Suivant