4/10012PCmatlab2007122612622631.[0.19050.071400.30950.11900.07140.11900.1190]2.61982615229476918133384411175863512113942810715412254919102902.260.09210.01760.02850.04180.10960.02000.02300.02670.06720.00420.00300.05210.02120.07330.08420.02540.00480.06480.09330.07390.03270.00550.01150.00610.01760hijklmn0.02670.06720.00420.00300.05210.02120.0733opqrstu0.08420.02540.00480.06480.09330.07390.03274.16971ASCII2ASCIIASCII26ASCIIaASCII0-250-252625261.fopenMATLABfread2.ASCII3.P01//10021.2.3.4.5.6.7.8.9.1.MATLABclcclearall%string='abdddssdsssdabaabaddkkidkidkdiakdjjaidjaid';%string=lower(string);%ASCIIaASCIInum=string-'a';%26fori=1:2005forj=1:26b(j)=sum(num==j-1);endenddisp('26');disp(b)%26s=0;fori=1:26s=s+b(i);endc=b/s;disp('26');disp(c)%w=0;fori=1:26ifc(i)~=0;w=w-c(i)*log2(c(i));endenddisp('')disp(w)2.MATLABclcclearall%d=fopen('TypesofSpeech.txt','r');%string=fread(d,'*char');%string=lower(string);%ASCIIaASCIInum=string-'a';%26fori=1:2005forj=1:26b(j)=sum(num==j-1);endenddisp('26');disp(b)%26s=0;fori=1:26s=s+b(i);endc=b/s;disp('26');disp(c)%w=0;fori=1:25ifc(i)~=0;w=w-c(i)*log2(c(i));endenddisp('')disp(w)