Hi, I have a vectro of Strings like v =['def', 'def', 'def', 'atq', 'atq', 'dex', 'dex',….] How can I get a numerical vector like v_num =[1, 1, 1, 2, 2, 3, 3, …] So I want all "classlables" to be converted into a numerical "classlable". E.g all 'def's become 1 and all 'atq' become 2 and so on Thanks Tris
MATLAB: Converting a vector of stings into a numerical vector
classificationclasslablesMATLABstring to intstring to numstring to numericalvector
Related Question
- Produce a matrix from pointwise outer product from vectors of different length
- Find the maximum value in different vectors and from which vector is it
- Replace the string a cell array with empty cell
- How to transform UV coordinates to spherical coordinates, phi-theta or azimuth-elevation
- How can i account for the last variable of a vector while comparing the n and (n+1) variables
- How to read a text file into a list
Best Answer