Main Content

tostring

값을 string형으로 변환

설명

예제

str = tostring(X)는 숫자, 부울형 또는 열거형 데이터 X를 string형으로 변환합니다.

참고

tostring 연산자는 C를 동작 언어로 사용하는 Stateflow® 차트에서만 지원됩니다. MATLAB®을 동작 언어로 사용하는 차트에서는 string을 사용하십시오.

예제

모두 확장

숫자형 값을 string형 "1.2345"로 변환합니다.

str = tostring(1.2345);

Stateflow chart that uses the tostring operator in a state.

부울 값을 string형 "true"로 변환합니다.

str = tostring(true);

Stateflow chart that uses the tostring operator in a state.

열거형 값을 string형 "RED"로 변환합니다.

str = tostring(RED);

Stateflow chart that uses the tostring operator in a state.

버전 내역

R2018b에 개발됨