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 vue (au cours des 30 derniers jours)

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!

Réponse acceptée

Guillaume
Guillaume le 18 Oct 2019
cell2mat(yourcellarray) - 'A' + 1

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by