convert an array of alphabet letters into numbers ; A =a1, B =2, C = 3 etc.

15 次查看(过去 30 天)
Hi everyone can you have me solve this problem
i have a code change numbers into letters is
Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
numbers = [3,6,12,1,1,3]
letters = Alphabet(numbers)
Can you give me a code change letters into numbers ?
Thanks you very much

采纳的回答

madhan ravi
madhan ravi 2020-7-4
Alphabet = ['C F L A A C' ];
[ii, lo] = ismember(Alphabet, 'A':'Z');
Numbers = lo(ii)

更多回答(1 个)

Kanupriya Singh
Kanupriya Singh 2020-7-4
I think using this code would help you out:
word = 'WELCOME'
double(word) - 64

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by