-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathletnum_rec.m
More file actions
executable file
·75 lines (71 loc) · 1.52 KB
/
letnum_rec.m
File metadata and controls
executable file
·75 lines (71 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
function letnum_rec=letnum_rec(letnum,lettermod_sz);
[y,x,z]=size(lettermod_sz);
for k=1:34
sum=0;
for i=1:y
for j=1:x
if letnum(i,j,k)==lettermod_sz(i,j)%
sum=sum+1;
end
end
end
baifenbi(1,k)=double(sum/(x*y));
end
chepai= find(baifenbi>=max(baifenbi));
chepai=chepai(1,1);
if (chepai>=1)&&(chepai<=10)
zm_sz=chepai-1;
zm_sz=num2str(zm_sz);
elseif (chepai>=11)&&(chepai<=34)
%=========11-15 ABCDE 16-20FGHIJ 21-25 KLMNP 26-30 QRSTU 31-35 VWXYZ
if chepai==11
zm_sz='A';
elseif chepai==12
zm_sz='B';
elseif chepai==13
zm_sz='C';
elseif chepai==14
zm_sz='D';
elseif chepai==15
zm_sz='E';
elseif chepai==16
zm_sz='F';
elseif chepai==17
zm_sz='G';
elseif chepai==18
zm_sz='H';
elseif chepai==19
zm_sz='J';
elseif chepai==20
zm_sz='K';
elseif chepai==21
zm_sz='L';
elseif chepai==22
zm_sz='M';
elseif chepai==23
zm_sz='N';
elseif chepai==24
zm_sz='P';
elseif chepai==25
zm_sz='Q';
elseif chepai==26
zm_sz='R';
elseif chepai==27
zm_sz='S';
elseif chepai==28
zm_sz='T';
elseif chepai==29
zm_sz='U';
elseif chepai==30
zm_sz='V';
elseif chepai==31
zm_sz='W';
elseif chepai==32
zm_sz='X';
elseif chepai==33
zm_sz='Y';
elseif chepai==34
zm_sz='Z';
end
end
letnum_rec=zm_sz;