How to transform a string vector in a number vector.

1 visualización (últimos 30 días)
Light.16
Light.16 el 6 de Oct. de 2016
Respondida: Matthias Walle el 6 de Oct. de 2016
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!!

Respuestas (1)

Matthias Walle
Matthias Walle el 6 de Oct. de 2016
Hello,
This is called enumeration classes.
I hope this is what you were looking for,
Matthias

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by