필터 지우기
필터 지우기

How to transform a string vector in a number vector.

조회 수: 2 (최근 30일)
Light.16
Light.16 2016년 10월 6일
답변: Matthias Walle 2016년 10월 6일
Hello guys !
I've a vector of 3 element x = ['hot' , 'cold' ,'warm'] and i want to assign a number at every words. For example.. hot = 1, cold = 2 , warm = 3 .. so that my vector x become x= [ 1 2 3].
How can i do it with a cicle?
thank you!!

답변 (1개)

Matthias Walle
Matthias Walle 2016년 10월 6일
Hello,
This is called enumeration classes.
I hope this is what you were looking for,
Matthias

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by