Main Content

string

Create a string

Description

str = string(A) converts the input data to a string data. For instance, if A is numeric vector 29, str is a string array of the same size, "29".

Note

The operator string is supported only in Stateflow® charts that use MATLAB® as the action language.

Examples

expand all

Convert 1307 to a string and assign it to str.

a = 1307;
str = string(a)

Stateflow chart that uses the string operator in a state.

Result of the string operator

Introduced in R2021b