Main Content

tostring

Convertire un valore in stringa

Descrizione

esempio

str = tostring(X) converte dati numerici, booleani o enumerati X in una stringa.

Nota

L'operatore tostring è supportato solo nei grafici Stateflow® che utilizzano C come linguaggio di azione. Nei grafici che utilizzano MATLAB® come linguaggio di azione, utilizzare string.

Esempi

espandi tutto

Convertire il valore numerico nella stringa "1.2345".

str = tostring(1.2345);

Stateflow chart that uses the tostring operator in a state.

Convertire un valore booleano nella stringa "true".

str = tostring(true);

Stateflow chart that uses the tostring operator in a state.

Convertire un valore enumerato nella stringa "RED".

str = tostring(RED);

Stateflow chart that uses the tostring operator in a state.

Cronologia versioni

Introdotto in R2018b