MATLAB Help Center
Convert value to string in Stateflow chart
Since R2021b
str = string(X)
str = string(X) converts the input X to a string.
str
X
example
Note
The operator string is not supported in Stateflow® charts that use C as the action language. For similar functionality, use tostring.
string
tostring
expand all
Convert integer scalar to string "1307".
"1307"
str = string(1307);
Convert Boolean value to string "true".
"true"
str = string(true);
Create string that contains five spaces.
str = string(blanks(5));
Input value, specified as an integer scalar, Boolean scalar, or character array. To create a character array of spaces, use the operator blanks.
blanks
Example: str = string(1307)
str = string(1307)
Example: str = string(true)
str = string(true)
Example: str = string(blanks(n))
str = string(blanks(n))
Introduced in R2021b
str2double | blanks | tostring
str2double
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office