How to convert characters array into integer number array
Mostrar comentarios más antiguos
Hello,
I have a text file in which all the contents are characters like a,b,c,d…z . Can somone explain how to convert theses alphabets in txt file into numbers like a corresponds to1, b corresponds to 2 ,in the converted file.
Thanks.
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 9 de Abr. de 2014
converted_to_numbers = characters - 'a' + 1;
Then it is just a matter of writing out the numbers as text, which you already know how to do.
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!