?? text2int1.m
字號:
function y = text2int1 (x)% This function takes the letter in the string x and converts % it to an integer. % The convention for this function is% ' ' --> 0% a --> 1% b --> 2% and so on...[s1,s2]=size(x);yvec=x - 'a'+1; inds=find(yvec<1);yvec(inds)=zeros(size(inds)); % set all the spaces to a value of 0% Now we must convert to a numbery=zeros(s1,1);for k=1:s1,for j=0:s2-1, ind=s2-j; y(k)=y(k)+yvec(k,ind)*100^(j); end;end;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -