Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I convert a string of alphabetical characters to a vector of their numerical equivalent ie A->1, B->2 etc

조회 수: 1 (최근 30일)
I need to find a way to quickly convert large lists of dictionary words into a vector of integers corresponding to the letters number in the alphabet (1-26). ie. 'BAT' -> [2 1 20]. What is the best way to achieve this result? Thanks in advance for your help!

답변 (1개)

dpb
dpb 2013년 12월 4일
>> double('BAT'-'@')
ans =
2 1 20
>>

Community Treasure Hunt

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

Start Hunting!

Translated by