Main Content


Create a string


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".


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


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

Version History

Introduced in R2021b