Convert categorical to string
381 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
NAVNEET NAYAN
el 2 de Oct. de 2021
Comentada: Stephen23
el 17 de Dic. de 2024
I have two categorical column vectors of size 872-by-1. I want to calculate the Levenshtein distance between these two. When I am using the command 'editDistance' for this I am getting an error as
"Argument 1 must be a string array, a character vector, or a cell array of character vectors."
After searching the solution for this problem, I thought to convert it to string, but I am not getting a way for this. How can I convert categorical column vector to string? or how can I resolve the error?
In case of any query feel free to comment.
0 comentarios
Respuesta aceptada
Stephen23
el 2 de Oct. de 2021
Movida: Stephen23
el 17 de Dic. de 2024
V1 = categorical([1,2,3,2,2,1])
V2 = categorical([3,1,2,2,1,1])
S1 = string(V1)
S2 = string(V2)
3 comentarios
Mike Croucher
el 17 de Dic. de 2024
Movida: Stephen23
el 17 de Dic. de 2024
This is a highly viewed post (Over 400 views in the last 30 days) but it looks unanswered due to the fact that @Stephen23 did all the good work in the comments thread. Would you like to turn it into an answer @Stephen23? I'd do it but I don't want to steal your points :)
Stephen23
el 17 de Dic. de 2024
@Mike Croucher: there are no points for comments. Feel free to move!
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Conversion 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!