string - Convert value to string in Stateflow chart - MATLAB (original) (raw)

Main Content

Convert value to string in Stateflow chart

Since R2021b

Syntax

Description

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

example

Note

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

Examples

expand all

Convert integer scalar to string "1307".

Stateflow chart that uses the string operator in a state.

Convert Boolean value to string "true".

Stateflow chart that uses the string operator in a state.

Create string that contains five spaces.

Stateflow chart that uses the blanks operator in a state.

Input Arguments

expand all

Input value, specified as an 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