% For each team, this program computes the overall win-loss-tie (w-l-t) percentage, % the w-l-t percentage in the division, the w-l-t percentage in the conference, the % strength of victory, and the strength of schedule. % Index of teams: % 1 Buf 5 Balt 9 Hou 13 Den % 2 Mia 6 Cin 10 Ind 14 KC % 3 NE 7 Cle 11 Jax 15 Oak % 4 Jets 8 Pitt 12 TN 16 SD % 17 Dal 21 Chi 25 Atl 29 Ari % 18 NYG 22 Det 26 Car 30 StL % 19 Phil 23 GB 27 NO 31 SF % 20 Wash 24 MN 28 TB 32 Sea % Copyright 2006 by William S. Krasker conf=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2]'; div= [1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8]'; % Find overall win-loss-tie percentage. A tie is half a loss and half a win. wltpct=zeros(32,1); wins=zeros(32,1); for j=1:256 if a(j,3)==1 wins(a(j,1))=wins(a(j,1))+1; elseif a(j,3)==0 wins(a(j,2))=wins(a(j,2))+1; else wins(a(j,1))=wins(a(j,1))+0.5; wins(a(j,2))=wins(a(j,2))+0.5; end end wltpct=wins/16; % Find win-loss-tie percentage in the conference. cwltpct=zeros(32,1); wins=zeros(32,1); for j=1:256 if conf(a(j,1))==conf(a(j,2)) if a(j,3)==1 wins(a(j,1))=wins(a(j,1))+1; elseif a(j,3)==0 wins(a(j,2))=wins(a(j,2))+1; else wins(a(j,1))=wins(a(j,1))+0.5; wins(a(j,2))=wins(a(j,2))+0.5; end end end cwltpct=wins/12; % Find win-loss-tie percentage in the division. dwltpct=zeros(32,1); wins=zeros(32,1); for j=1:256 if div(a(j,1))==div(a(j,2)) if a(j,3)==1 wins(a(j,1))=wins(a(j,1))+1; elseif a(j,3)==0 wins(a(j,2))=wins(a(j,2))+1; else wins(a(j,1))=wins(a(j,1))+0.5; wins(a(j,2))=wins(a(j,2))+0.5; end end end dwltpct=wins/6; % Get strength of victory and strength of schedule. sov=zeros(32,1); sos=zeros(32,1); m=zeros(32,1); for j=1:256 sos(a(j,1))=sos(a(j,1))+wltpct(a(j,2)); sos(a(j,2))=sos(a(j,2))+wltpct(a(j,1)); if a(j,3)==1 m(a(j,1))=m(a(j,1))+1; sov(a(j,1))=sov(a(j,1))+wltpct(a(j,2)); elseif a(j,3)==0 m(a(j,2))=m(a(j,2))+1; sov(a(j,2))=sov(a(j,2))+wltpct(a(j,1)); end end sos=sos/16; for i=1:32 if m(i)==0 sov(i)=0; else sov(i)=sov(i)/m(i); end end