tostring - Convert value to string - MATLAB (original) (raw)
Convert value to string
Syntax
[str = tostring(X)](#d126e21956)
Description
`str` = tostring(`X`)
converts numeric, Boolean, or enumerated data X
to a string.
Note
The operator tostring
is supported only in Stateflow® charts that use C as the action language. In charts that use MATLAB® as the action language, use string.
Examples
Convert numeric value to string "1.2345"
.
str = tostring(1.2345);
Convert Boolean value to string "true"
.
str = tostring(true);
Convert enumerated value to string "RED"
.
str = tostring(RED);
Version History
Introduced in R2018b