tostring

Convert numeric value to string

Description

example

dest = tostring(X) converts numeric, Boolean, or enumerated data X to a string.

Examples

expand all

Convert numeric value to string "1.2345".

dest = tostring(1.2345);

Convert Boolean value to string "true".

dest = tostring(1==1);

Convert enumerated value to string "RED".

dest = tostring(RED);

Tips

  • Use in Stateflow® charts that use C as the action language.

Introduced in R2018b