How to convert a letter to a number in a cell array? Number = alphabetical order location. i.e. A = 1, B = 2, C = 3, etc.

1 visualización (últimos 30 días)

Hello, I have a cell array full of letters and I want to convert them to there corresponding alphabetical order location. For example A = 1, B = 2, C = 3, etc.
Each row in my cell array is just a single capitalized letter like so: {'A'}
Thanks for any help!

Respuesta aceptada

Guillaume
Guillaume el 18 de Oct. de 2019
cell2mat(yourcellarray) - 'A' + 1

Más respuestas (0)

Categorías

Más información sobre Data Types 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