Constructing State Transition Probability Matrix clear A = xlsread('200sample', 'A1:A200 ); t = length(A); B = unique(A); tt = length(B); E = sort(B,'ascend'); T = zeros(16,16); TR = zeros(16,16); a = 0; b = 0; c = 0; d = 0; e = 0;

f = 0; g = 0; h = 0; k = 0; l = 0; m = 0; n = 0; o = 0; p = 0; q = 0; r = 0; for j=1:1:tt Localization=find(A==E(j)); for i=1:1:length(Localization) if Localization(i)+1>t break; elseif A(Localization(i)+1)==E(1) a = a+1; elseif A(Localization(i)+1)==E(2) b = b+1; elseif A(Localization(i)+1)==E(3) c = c+1; elseif A(Localization(i)+1)==E(4) d = d+1; elseif A(Localization(i)+1)==E(5) e = e+1; elseif A(Localization(i)+1)==E(6) f = f+1; elseif A(Localization(i)+1)==E(7) g = g+1; elseif A(Localization(i)+1)==E(8) h = h+1; elseif A(Localization(i)+1)==E(9) k = k+1; elseif A(Localization(i)+1)==E(10) l = l+1; elseif A(Localization(i)+1)==E(11) m = m+1; elseif A(Localization(i)+1)==E(12) n = n+1; elseif A(Localization(i)+1)==E(13) o = o+1; elseif A(Localization(i)+1)==E(14) p = p+1; elseif A(Localization(i)+1)==E(15) q = q+1; elseif A(Localization(i)+1)==E(16) r = r+1; end end T(j,1:tt) = [a,b,c,d,e,f,g,h,k,l,m,n,o,p,q,r]; end TT = T; for u=2:1:tt TT(u,:)=T(u,:)-T(u-1,:); end TT; Y = sum(TT,2); for uu = 1:1:tt TR(uu,:) = TT(uu,:)./Y(uu,1); end

```
TR