Main Content


Convert value to string in Stateflow chart

Since R2021b



str = string(X) converts the input X to a string.


The operator string is not supported in Stateflow® charts that use C as the action language. For similar functionality, use tostring.


expand all

Convert integer scalar to string "1307".

str = string(1307);

Stateflow chart that uses the string operator in a state.

Convert Boolean value to string "true".

str = string(true);

Stateflow chart that uses the tostring operator in a state.

Input Arguments

expand all

Input value, specified as a integer scalar, Boolean scalar, or character array. To create a character array of spaces, use the operator blanks.

Example: str = string(1307)

Example: str = string(true)

Example: str = string(blanks(n))

Version History

Introduced in R2021b