如何用matlab将26个英文字母转化成0~25

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 07:32:24
如何用matlab将26个英文字母转化成0~25
x){ީϧM,ILzɎU/7>tg{_]gڳ uF6IEk/!Ӯ"[TuէSs=/5<]|V A9E Pn6(4$xo]ɘK2mKSr { .cu1 <;PHR

如何用matlab将26个英文字母转化成0~25
如何用matlab将26个英文字母转化成0~25

如何用matlab将26个英文字母转化成0~25
char='e' %单引号里面是你要转换的英文字母
char=lower(char); % 转为小写
num=char-'a'
输出:num=4
string='fgtrsdgf' %单引号里面是你要转换的英文字母
string=lower(string); % 转为小写
num=string-'a'
输出:num = 5 6 19 17 18 3 6 5