Main Content

tostring

Convert numeric value to string

Description

example

dest = 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.

Examples

expand all

Convert numeric value to string "1.2345".

dest = tostring(1.2345);

Stateflow chart that uses the tostring operator in a state.

Convert Boolean value to string "true".

dest = tostring(1==1);

Stateflow chart that uses the tostring operator in a state.

Convert enumerated value to string "RED".

dest = tostring(RED);

Stateflow chart that uses the tostring operator in a state.

Introduced in R2018b