function [LH OSeq TMatrix] = EV4_hierarchy(Seq) %number of training sequences






Sizzz=size(Seq);

AS=Seq;
Seq=Seq';
Seq=Seq(:);
ind=~cellfun(@isempty,Seq);
Seq=Seq(ind);
OSeq=Seq;

k=1;
PS={'' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ''};

Seq=AS;

for i=1:Sizzz(1)
    for j=1:Sizzz(2)
        if strcmp(Seq{i,j},'SFL') || strcmp(Seq{i,j},'SNL') || strcmp(Seq{i,j},'SFR') || strcmp(Seq{i,j},'SNR')
        PS(i,j) = {'S'};
        elseif strcmp(Seq{i,j},'HF') || strcmp(Seq{i,j},'HN')
        PS(i,j) = {'H'};
        elseif strcmp(Seq{i,j},'BIF') || strcmp(Seq{i,j},'BIN') || strcmp(Seq{i,j},'BOF') || strcmp(Seq{i,j},'BON') || strcmp(Seq{i,j},'BIFSL')...
                || strcmp(Seq{i,j},'BINSL') ||  strcmp(Seq{i,j},'BIFSR') || strcmp(Seq{i,j},'BINSR')|| strcmp(Seq{i,j},'BOFS') || strcmp(Seq{i,j},'BONS')
        PS(i,j) = {'B'};
        end
    end
end


PS=PS';
PS=PS(:);
PS(~ind)=[];
for i=1:length(PS)
    if strcmp(PS{i},'S')
        T2(i) = 1; 
    elseif strcmp(PS{i},'H')
        T2(i) = 2; 
    elseif strcmp(PS{i},'B')
        T2(i) = 3; 
    end
end
Seq2=PS;
Seq=OSeq;
ind=cellfun(@isempty,Seq2);
Seq2(ind)=[];

To2 = zeros(3,3);
Sparsed_To2 = (full(sparse(T2(1:end-1),T2(2:end),1)));
S = size(Sparsed_To2);
Sparsed_To2(S(1)+1:3,S(2)+1:3)=0;
TMat2=mat2tmat(Sparsed_To2); %Topology without point allocation

TMat3=Build_master_topology(Seq);

New_Topology = zeros(16,16);

for i=1:length(Seq)-1
    
    if strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,1)=TMat3(1,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,1)=TMat3(1,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,1)=TMat3(1,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,1)=TMat3(1,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,1)=TMat3(1,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,1)=TMat3(1,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,1)=TMat3(1,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,1)=TMat3(1,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,1)=TMat3(1,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,2)=TMat3(1,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,2)=TMat3(1,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,2)=TMat3(1,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,2)=TMat3(1,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,2)=TMat3(1,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,2)=TMat3(1,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,2)=TMat3(1,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,2)=TMat3(1,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,2)=TMat3(1,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,3)=TMat3(1,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,3)=TMat3(1,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,3)=TMat3(1,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,3)=TMat3(1,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,3)=TMat3(1,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,3)=TMat3(1,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,3)=TMat3(1,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,3)=TMat3(1,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,3)=TMat3(1,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,4)=TMat3(1,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,4)=TMat3(1,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,4)=TMat3(1,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,4)=TMat3(1,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,4)=TMat3(1,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,4)=TMat3(1,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,4)=TMat3(1,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,4)=TMat3(1,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,4)=TMat3(1,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,5)=TMat3(1,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,5)=TMat3(1,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,5)=TMat3(1,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,5)=TMat3(1,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,5)=TMat3(1,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,5)=TMat3(1,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,5)=TMat3(1,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,5)=TMat3(1,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,5)=TMat3(1,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,6)=TMat3(1,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,6)=TMat3(1,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,6)=TMat3(1,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,6)=TMat3(1,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,6)=TMat3(1,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,6)=TMat3(1,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,6)=TMat3(1,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,6)=TMat3(1,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,6)=TMat3(1,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,7)=TMat3(1,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,7)=TMat3(1,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,7)=TMat3(1,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,7)=TMat3(1,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,7)=TMat3(1,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,7)=TMat3(1,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,7)=TMat3(1,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,7)=TMat3(1,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,7)=TMat3(1,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,8)=TMat3(1,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,8)=TMat3(1,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,8)=TMat3(1,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,8)=TMat3(1,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,8)=TMat3(1,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,8)=TMat3(1,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,8)=TMat3(1,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,8)=TMat3(1,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,8)=TMat3(1,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,9)=TMat3(1,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,9)=TMat3(1,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,9)=TMat3(1,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,9)=TMat3(1,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,9)=TMat3(1,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,9)=TMat3(1,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,9)=TMat3(1,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,9)=TMat3(1,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,9)=TMat3(1,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,10)=TMat3(1,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,10)=TMat3(1,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,10)=TMat3(1,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,10)=TMat3(1,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,10)=TMat3(1,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,10)=TMat3(1,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,10)=TMat3(1,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,10)=TMat3(1,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,10)=TMat3(1,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,11)=TMat3(1,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,11)=TMat3(1,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,11)=TMat3(1,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,11)=TMat3(1,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,11)=TMat3(1,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,11)=TMat3(1,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,11)=TMat3(1,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,11)=TMat3(1,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,11)=TMat3(1,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,12)=TMat3(1,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,12)=TMat3(1,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,12)=TMat3(1,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,12)=TMat3(1,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,12)=TMat3(1,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,12)=TMat3(1,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,12)=TMat3(1,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,12)=TMat3(1,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,12)=TMat3(1,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,13)=TMat3(1,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,13)=TMat3(1,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,13)=TMat3(1,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,13)=TMat3(1,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,13)=TMat3(1,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,13)=TMat3(1,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,13)=TMat3(1,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,13)=TMat3(1,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,13)=TMat3(1,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,14)=TMat3(1,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,14)=TMat3(1,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,14)=TMat3(1,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,14)=TMat3(1,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,14)=TMat3(1,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,14)=TMat3(1,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,14)=TMat3(1,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,14)=TMat3(1,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,14)=TMat3(1,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,15)=TMat3(1,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,15)=TMat3(1,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,15)=TMat3(1,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,15)=TMat3(1,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,15)=TMat3(1,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,15)=TMat3(1,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,15)=TMat3(1,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,15)=TMat3(1,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,15)=TMat3(1,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFL') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(1,16)=TMat3(1,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(1,16)=TMat3(1,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(1,16)=TMat3(1,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(1,16)=TMat3(1,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(1,16)=TMat3(1,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(1,16)=TMat3(1,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(1,16)=TMat3(1,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(1,16)=TMat3(1,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(1,16)=TMat3(1,16)*TMat2(3,3); end
        
        % *1
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,1)=TMat3(2,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,1)=TMat3(2,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,1)=TMat3(2,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,1)=TMat3(2,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,1)=TMat3(2,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,1)=TMat3(2,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,1)=TMat3(2,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,1)=TMat3(2,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,1)=TMat3(2,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,2)=TMat3(2,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,2)=TMat3(2,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,2)=TMat3(2,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,2)=TMat3(2,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,2)=TMat3(2,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,2)=TMat3(2,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,2)=TMat3(2,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,2)=TMat3(2,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,2)=TMat3(2,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,3)=TMat3(2,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,3)=TMat3(2,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,3)=TMat3(2,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,3)=TMat3(2,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,3)=TMat3(2,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,3)=TMat3(2,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,3)=TMat3(2,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,3)=TMat3(2,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,3)=TMat3(2,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,4)=TMat3(2,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,4)=TMat3(2,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,4)=TMat3(2,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,4)=TMat3(2,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,4)=TMat3(2,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,4)=TMat3(2,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,4)=TMat3(2,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,4)=TMat3(2,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,4)=TMat3(2,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,5)=TMat3(2,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,5)=TMat3(2,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,5)=TMat3(2,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,5)=TMat3(2,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,5)=TMat3(2,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,5)=TMat3(2,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,5)=TMat3(2,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,5)=TMat3(2,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,5)=TMat3(2,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,6)=TMat3(2,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,6)=TMat3(2,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,6)=TMat3(2,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,6)=TMat3(2,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,6)=TMat3(2,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,6)=TMat3(2,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,6)=TMat3(2,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,6)=TMat3(2,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,6)=TMat3(2,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,7)=TMat3(2,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,7)=TMat3(2,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,7)=TMat3(2,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,7)=TMat3(2,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,7)=TMat3(2,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,7)=TMat3(2,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,7)=TMat3(2,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,7)=TMat3(2,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,7)=TMat3(2,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,8)=TMat3(2,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,8)=TMat3(2,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,8)=TMat3(2,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,8)=TMat3(2,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,8)=TMat3(2,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,8)=TMat3(2,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,8)=TMat3(2,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,8)=TMat3(2,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,8)=TMat3(2,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,9)=TMat3(2,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,9)=TMat3(2,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,9)=TMat3(2,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,9)=TMat3(2,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,9)=TMat3(2,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,9)=TMat3(2,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,9)=TMat3(2,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,9)=TMat3(2,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,9)=TMat3(2,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,10)=TMat3(2,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,10)=TMat3(2,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,10)=TMat3(2,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,10)=TMat3(2,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,10)=TMat3(2,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,10)=TMat3(2,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,10)=TMat3(2,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,10)=TMat3(2,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,10)=TMat3(2,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,11)=TMat3(2,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,11)=TMat3(2,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,11)=TMat3(2,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,11)=TMat3(2,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,11)=TMat3(2,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,11)=TMat3(2,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,11)=TMat3(2,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,11)=TMat3(2,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,11)=TMat3(2,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,12)=TMat3(2,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,12)=TMat3(2,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,12)=TMat3(2,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,12)=TMat3(2,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,12)=TMat3(2,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,12)=TMat3(2,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,12)=TMat3(2,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,12)=TMat3(2,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,12)=TMat3(2,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,13)=TMat3(2,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,13)=TMat3(2,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,13)=TMat3(2,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,13)=TMat3(2,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,13)=TMat3(2,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,13)=TMat3(2,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,13)=TMat3(2,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,13)=TMat3(2,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,13)=TMat3(2,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,14)=TMat3(2,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,14)=TMat3(2,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,14)=TMat3(2,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,14)=TMat3(2,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,14)=TMat3(2,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,14)=TMat3(2,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,14)=TMat3(2,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,14)=TMat3(2,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,14)=TMat3(2,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,15)=TMat3(2,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,15)=TMat3(2,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,15)=TMat3(2,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,15)=TMat3(2,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,15)=TMat3(2,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,15)=TMat3(2,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,15)=TMat3(2,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,15)=TMat3(2,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,15)=TMat3(2,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SFR') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(2,16)=TMat3(2,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(2,16)=TMat3(2,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(2,16)=TMat3(2,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(2,16)=TMat3(2,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(2,16)=TMat3(2,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(2,16)=TMat3(2,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(2,16)=TMat3(2,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(2,16)=TMat3(2,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(2,16)=TMat3(2,16)*TMat2(3,3); end
        
        %*2
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,1)=TMat3(3,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,1)=TMat3(3,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,1)=TMat3(3,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,1)=TMat3(3,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,1)=TMat3(3,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,1)=TMat3(3,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,1)=TMat3(3,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,1)=TMat3(3,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,1)=TMat3(3,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,2)=TMat3(3,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,2)=TMat3(3,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,2)=TMat3(3,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,2)=TMat3(3,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,2)=TMat3(3,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,2)=TMat3(3,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,2)=TMat3(3,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,2)=TMat3(3,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,2)=TMat3(3,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,3)=TMat3(3,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,3)=TMat3(3,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,3)=TMat3(3,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,3)=TMat3(3,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,3)=TMat3(3,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,3)=TMat3(3,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,3)=TMat3(3,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,3)=TMat3(3,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,3)=TMat3(3,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,4)=TMat3(3,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,4)=TMat3(3,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,4)=TMat3(3,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,4)=TMat3(3,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,4)=TMat3(3,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,4)=TMat3(3,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,4)=TMat3(3,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,4)=TMat3(3,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,4)=TMat3(3,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,5)=TMat3(3,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,5)=TMat3(3,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,5)=TMat3(3,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,5)=TMat3(3,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,5)=TMat3(3,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,5)=TMat3(3,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,5)=TMat3(3,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,5)=TMat3(3,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,5)=TMat3(3,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,6)=TMat3(3,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,6)=TMat3(3,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,6)=TMat3(3,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,6)=TMat3(3,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,6)=TMat3(3,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,6)=TMat3(3,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,6)=TMat3(3,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,6)=TMat3(3,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,6)=TMat3(3,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,7)=TMat3(3,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,7)=TMat3(3,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,7)=TMat3(3,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,7)=TMat3(3,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,7)=TMat3(3,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,7)=TMat3(3,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,7)=TMat3(3,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,7)=TMat3(3,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,7)=TMat3(3,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,8)=TMat3(3,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,8)=TMat3(3,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,8)=TMat3(3,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,8)=TMat3(3,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,8)=TMat3(3,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,8)=TMat3(3,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,8)=TMat3(3,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,8)=TMat3(3,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,8)=TMat3(3,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,9)=TMat3(3,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,9)=TMat3(3,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,9)=TMat3(3,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,9)=TMat3(3,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,9)=TMat3(3,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,9)=TMat3(3,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,9)=TMat3(3,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,9)=TMat3(3,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,9)=TMat3(3,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,10)=TMat3(3,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,10)=TMat3(3,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,10)=TMat3(3,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,10)=TMat3(3,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,10)=TMat3(3,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,10)=TMat3(3,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,10)=TMat3(3,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,10)=TMat3(3,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,10)=TMat3(3,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,11)=TMat3(3,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,11)=TMat3(3,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,11)=TMat3(3,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,11)=TMat3(3,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,11)=TMat3(3,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,11)=TMat3(3,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,11)=TMat3(3,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,11)=TMat3(3,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,11)=TMat3(3,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,12)=TMat3(3,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,12)=TMat3(3,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,12)=TMat3(3,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,12)=TMat3(3,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,12)=TMat3(3,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,12)=TMat3(3,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,12)=TMat3(3,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,12)=TMat3(3,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,12)=TMat3(3,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,13)=TMat3(3,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,13)=TMat3(3,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,13)=TMat3(3,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,13)=TMat3(3,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,13)=TMat3(3,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,13)=TMat3(3,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,13)=TMat3(3,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,13)=TMat3(3,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,13)=TMat3(3,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,14)=TMat3(3,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,14)=TMat3(3,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,14)=TMat3(3,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,14)=TMat3(3,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,14)=TMat3(3,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,14)=TMat3(3,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,14)=TMat3(3,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,14)=TMat3(3,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,14)=TMat3(3,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,15)=TMat3(3,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,15)=TMat3(3,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,15)=TMat3(3,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,15)=TMat3(3,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,15)=TMat3(3,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,15)=TMat3(3,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,15)=TMat3(3,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,15)=TMat3(3,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,15)=TMat3(3,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNL') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(3,16)=TMat3(3,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(3,16)=TMat3(3,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(3,16)=TMat3(3,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(3,16)=TMat3(3,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(3,16)=TMat3(3,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(3,16)=TMat3(3,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(3,16)=TMat3(3,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(3,16)=TMat3(3,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(3,16)=TMat3(3,16)*TMat2(3,3); end
        
        %*3
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,1)=TMat3(4,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,1)=TMat3(4,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,1)=TMat3(4,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,1)=TMat3(4,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,1)=TMat3(4,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,1)=TMat3(4,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,1)=TMat3(4,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,1)=TMat3(4,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,1)=TMat3(4,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,2)=TMat3(4,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,2)=TMat3(4,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,2)=TMat3(4,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,2)=TMat3(4,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,2)=TMat3(4,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,2)=TMat3(4,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,2)=TMat3(4,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,2)=TMat3(4,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,2)=TMat3(4,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,3)=TMat3(4,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,3)=TMat3(4,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,3)=TMat3(4,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,3)=TMat3(4,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,3)=TMat3(4,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,3)=TMat3(4,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,3)=TMat3(4,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,3)=TMat3(4,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,3)=TMat3(4,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,4)=TMat3(4,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,4)=TMat3(4,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,4)=TMat3(4,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,4)=TMat3(4,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,4)=TMat3(4,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,4)=TMat3(4,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,4)=TMat3(4,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,4)=TMat3(4,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,4)=TMat3(4,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,5)=TMat3(4,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,5)=TMat3(4,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,5)=TMat3(4,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,5)=TMat3(4,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,5)=TMat3(4,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,5)=TMat3(4,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,5)=TMat3(4,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,5)=TMat3(4,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,5)=TMat3(4,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,6)=TMat3(4,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,6)=TMat3(4,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,6)=TMat3(4,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,6)=TMat3(4,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,6)=TMat3(4,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,6)=TMat3(4,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,6)=TMat3(4,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,6)=TMat3(4,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,6)=TMat3(4,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,7)=TMat3(4,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,7)=TMat3(4,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,7)=TMat3(4,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,7)=TMat3(4,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,7)=TMat3(4,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,7)=TMat3(4,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,7)=TMat3(4,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,7)=TMat3(4,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,7)=TMat3(4,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,8)=TMat3(4,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,8)=TMat3(4,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,8)=TMat3(4,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,8)=TMat3(4,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,8)=TMat3(4,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,8)=TMat3(4,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,8)=TMat3(4,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,8)=TMat3(4,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,8)=TMat3(4,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,9)=TMat3(4,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,9)=TMat3(4,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,9)=TMat3(4,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,9)=TMat3(4,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,9)=TMat3(4,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,9)=TMat3(4,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,9)=TMat3(4,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,9)=TMat3(4,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,9)=TMat3(4,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,10)=TMat3(4,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,10)=TMat3(4,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,10)=TMat3(4,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,10)=TMat3(4,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,10)=TMat3(4,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,10)=TMat3(4,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,10)=TMat3(4,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,10)=TMat3(4,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,10)=TMat3(4,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,11)=TMat3(4,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,11)=TMat3(4,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,11)=TMat3(4,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,11)=TMat3(4,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,11)=TMat3(4,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,11)=TMat3(4,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,11)=TMat3(4,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,11)=TMat3(4,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,11)=TMat3(4,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,12)=TMat3(4,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,12)=TMat3(4,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,12)=TMat3(4,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,12)=TMat3(4,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,12)=TMat3(4,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,12)=TMat3(4,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,12)=TMat3(4,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,12)=TMat3(4,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,12)=TMat3(4,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,13)=TMat3(4,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,13)=TMat3(4,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,13)=TMat3(4,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,13)=TMat3(4,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,13)=TMat3(4,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,13)=TMat3(4,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,13)=TMat3(4,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,13)=TMat3(4,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,13)=TMat3(4,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,14)=TMat3(4,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,14)=TMat3(4,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,14)=TMat3(4,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,14)=TMat3(4,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,14)=TMat3(4,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,14)=TMat3(4,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,14)=TMat3(4,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,14)=TMat3(4,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,14)=TMat3(4,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,15)=TMat3(4,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,15)=TMat3(4,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,15)=TMat3(4,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,15)=TMat3(4,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,15)=TMat3(4,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,15)=TMat3(4,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,15)=TMat3(4,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,15)=TMat3(4,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,15)=TMat3(4,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'SNR') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(4,16)=TMat3(4,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(4,16)=TMat3(4,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(4,16)=TMat3(4,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(4,16)=TMat3(4,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(4,16)=TMat3(4,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(4,16)=TMat3(4,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(4,16)=TMat3(4,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(4,16)=TMat3(4,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(4,16)=TMat3(4,16)*TMat2(3,3); end
        
        %*4
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,1)=TMat3(5,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,1)=TMat3(5,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,1)=TMat3(5,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,1)=TMat3(5,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,1)=TMat3(5,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,1)=TMat3(5,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,1)=TMat3(5,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,1)=TMat3(5,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,1)=TMat3(5,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,2)=TMat3(5,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,2)=TMat3(5,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,2)=TMat3(5,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,2)=TMat3(5,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,2)=TMat3(5,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,2)=TMat3(5,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,2)=TMat3(5,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,2)=TMat3(5,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,2)=TMat3(5,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,3)=TMat3(5,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,3)=TMat3(5,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,3)=TMat3(5,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,3)=TMat3(5,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,3)=TMat3(5,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,3)=TMat3(5,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,3)=TMat3(5,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,3)=TMat3(5,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,3)=TMat3(5,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,4)=TMat3(5,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,4)=TMat3(5,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,4)=TMat3(5,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,4)=TMat3(5,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,4)=TMat3(5,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,4)=TMat3(5,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,4)=TMat3(5,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,4)=TMat3(5,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,4)=TMat3(5,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,5)=TMat3(5,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,5)=TMat3(5,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,5)=TMat3(5,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,5)=TMat3(5,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,5)=TMat3(5,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,5)=TMat3(5,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,5)=TMat3(5,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,5)=TMat3(5,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,5)=TMat3(5,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,6)=TMat3(5,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,6)=TMat3(5,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,6)=TMat3(5,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,6)=TMat3(5,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,6)=TMat3(5,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,6)=TMat3(5,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,6)=TMat3(5,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,6)=TMat3(5,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,6)=TMat3(5,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,7)=TMat3(5,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,7)=TMat3(5,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,7)=TMat3(5,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,7)=TMat3(5,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,7)=TMat3(5,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,7)=TMat3(5,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,7)=TMat3(5,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,7)=TMat3(5,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,7)=TMat3(5,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,8)=TMat3(5,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,8)=TMat3(5,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,8)=TMat3(5,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,8)=TMat3(5,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,8)=TMat3(5,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,8)=TMat3(5,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,8)=TMat3(5,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,8)=TMat3(5,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,8)=TMat3(5,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,9)=TMat3(5,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,9)=TMat3(5,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,9)=TMat3(5,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,9)=TMat3(5,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,9)=TMat3(5,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,9)=TMat3(5,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,9)=TMat3(5,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,9)=TMat3(5,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,9)=TMat3(5,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,10)=TMat3(5,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,10)=TMat3(5,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,10)=TMat3(5,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,10)=TMat3(5,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,10)=TMat3(5,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,10)=TMat3(5,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,10)=TMat3(5,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,10)=TMat3(5,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,10)=TMat3(5,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,11)=TMat3(5,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,11)=TMat3(5,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,11)=TMat3(5,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,11)=TMat3(5,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,11)=TMat3(5,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,11)=TMat3(5,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,11)=TMat3(5,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,11)=TMat3(5,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,11)=TMat3(5,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,12)=TMat3(5,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,12)=TMat3(5,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,12)=TMat3(5,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,12)=TMat3(5,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,12)=TMat3(5,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,12)=TMat3(5,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,12)=TMat3(5,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,12)=TMat3(5,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,12)=TMat3(5,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,13)=TMat3(5,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,13)=TMat3(5,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,13)=TMat3(5,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,13)=TMat3(5,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,13)=TMat3(5,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,13)=TMat3(5,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,13)=TMat3(5,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,13)=TMat3(5,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,13)=TMat3(5,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,14)=TMat3(5,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,14)=TMat3(5,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,14)=TMat3(5,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,14)=TMat3(5,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,14)=TMat3(5,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,14)=TMat3(5,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,14)=TMat3(5,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,14)=TMat3(5,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,14)=TMat3(5,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,15)=TMat3(5,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,15)=TMat3(5,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,15)=TMat3(5,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,15)=TMat3(5,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,15)=TMat3(5,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,15)=TMat3(5,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,15)=TMat3(5,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,15)=TMat3(5,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,15)=TMat3(5,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HF') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(5,16)=TMat3(5,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(5,16)=TMat3(5,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(5,16)=TMat3(5,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(5,16)=TMat3(5,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(5,16)=TMat3(5,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(5,16)=TMat3(5,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(5,16)=TMat3(5,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(5,16)=TMat3(5,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(5,16)=TMat3(5,16)*TMat2(3,3); end
        
        %*5
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,1)=TMat3(6,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,1)=TMat3(6,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,1)=TMat3(6,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,1)=TMat3(6,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,1)=TMat3(6,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,1)=TMat3(6,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,1)=TMat3(6,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,1)=TMat3(6,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,1)=TMat3(6,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,2)=TMat3(6,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,2)=TMat3(6,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,2)=TMat3(6,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,2)=TMat3(6,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,2)=TMat3(6,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,2)=TMat3(6,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,2)=TMat3(6,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,2)=TMat3(6,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,2)=TMat3(6,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,3)=TMat3(6,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,3)=TMat3(6,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,3)=TMat3(6,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,3)=TMat3(6,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,3)=TMat3(6,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,3)=TMat3(6,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,3)=TMat3(6,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,3)=TMat3(6,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,3)=TMat3(6,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,4)=TMat3(6,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,4)=TMat3(6,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,4)=TMat3(6,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,4)=TMat3(6,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,4)=TMat3(6,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,4)=TMat3(6,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,4)=TMat3(6,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,4)=TMat3(6,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,4)=TMat3(6,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,5)=TMat3(6,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,5)=TMat3(6,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,5)=TMat3(6,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,5)=TMat3(6,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,5)=TMat3(6,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,5)=TMat3(6,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,5)=TMat3(6,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,5)=TMat3(6,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,5)=TMat3(6,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,6)=TMat3(6,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,6)=TMat3(6,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,6)=TMat3(6,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,6)=TMat3(6,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,6)=TMat3(6,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,6)=TMat3(6,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,6)=TMat3(6,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,6)=TMat3(6,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,6)=TMat3(6,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,7)=TMat3(6,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,7)=TMat3(6,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,7)=TMat3(6,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,7)=TMat3(6,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,7)=TMat3(6,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,7)=TMat3(6,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,7)=TMat3(6,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,7)=TMat3(6,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,7)=TMat3(6,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,8)=TMat3(6,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,8)=TMat3(6,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,8)=TMat3(6,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,8)=TMat3(6,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,8)=TMat3(6,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,8)=TMat3(6,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,8)=TMat3(6,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,8)=TMat3(6,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,8)=TMat3(6,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,9)=TMat3(6,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,9)=TMat3(6,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,9)=TMat3(6,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,9)=TMat3(6,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,9)=TMat3(6,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,9)=TMat3(6,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,9)=TMat3(6,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,9)=TMat3(6,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,9)=TMat3(6,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,10)=TMat3(6,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,10)=TMat3(6,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,10)=TMat3(6,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,10)=TMat3(6,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,10)=TMat3(6,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,10)=TMat3(6,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,10)=TMat3(6,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,10)=TMat3(6,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,10)=TMat3(6,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,11)=TMat3(6,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,11)=TMat3(6,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,11)=TMat3(6,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,11)=TMat3(6,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,11)=TMat3(6,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,11)=TMat3(6,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,11)=TMat3(6,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,11)=TMat3(6,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,11)=TMat3(6,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,12)=TMat3(6,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,12)=TMat3(6,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,12)=TMat3(6,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,12)=TMat3(6,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,12)=TMat3(6,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,12)=TMat3(6,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,12)=TMat3(6,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,12)=TMat3(6,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,12)=TMat3(6,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,13)=TMat3(6,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,13)=TMat3(6,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,13)=TMat3(6,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,13)=TMat3(6,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,13)=TMat3(6,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,13)=TMat3(6,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,13)=TMat3(6,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,13)=TMat3(6,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,13)=TMat3(6,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,14)=TMat3(6,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,14)=TMat3(6,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,14)=TMat3(6,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,14)=TMat3(6,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,14)=TMat3(6,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,14)=TMat3(6,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,14)=TMat3(6,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,14)=TMat3(6,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,14)=TMat3(6,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,15)=TMat3(6,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,15)=TMat3(6,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,15)=TMat3(6,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,15)=TMat3(6,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,15)=TMat3(6,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,15)=TMat3(6,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,15)=TMat3(6,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,15)=TMat3(6,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,15)=TMat3(6,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'HN') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(6,16)=TMat3(6,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(6,16)=TMat3(6,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(6,16)=TMat3(6,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(6,16)=TMat3(6,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(6,16)=TMat3(6,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(6,16)=TMat3(6,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(6,16)=TMat3(6,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(6,16)=TMat3(6,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(6,16)=TMat3(6,16)*TMat2(3,3); end
        
        %*6
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,1)=TMat3(7,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,1)=TMat3(7,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,1)=TMat3(7,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,1)=TMat3(7,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,1)=TMat3(7,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,1)=TMat3(7,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,1)=TMat3(7,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,1)=TMat3(7,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,1)=TMat3(7,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,2)=TMat3(7,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,2)=TMat3(7,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,2)=TMat3(7,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,2)=TMat3(7,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,2)=TMat3(7,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,2)=TMat3(7,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,2)=TMat3(7,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,2)=TMat3(7,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,2)=TMat3(7,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,3)=TMat3(7,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,3)=TMat3(7,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,3)=TMat3(7,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,3)=TMat3(7,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,3)=TMat3(7,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,3)=TMat3(7,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,3)=TMat3(7,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,3)=TMat3(7,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,3)=TMat3(7,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,4)=TMat3(7,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,4)=TMat3(7,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,4)=TMat3(7,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,4)=TMat3(7,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,4)=TMat3(7,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,4)=TMat3(7,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,4)=TMat3(7,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,4)=TMat3(7,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,4)=TMat3(7,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,5)=TMat3(7,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,5)=TMat3(7,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,5)=TMat3(7,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,5)=TMat3(7,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,5)=TMat3(7,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,5)=TMat3(7,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,5)=TMat3(7,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,5)=TMat3(7,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,5)=TMat3(7,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,6)=TMat3(7,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,6)=TMat3(7,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,6)=TMat3(7,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,6)=TMat3(7,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,6)=TMat3(7,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,6)=TMat3(7,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,6)=TMat3(7,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,6)=TMat3(7,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,6)=TMat3(7,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,7)=TMat3(7,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,7)=TMat3(7,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,7)=TMat3(7,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,7)=TMat3(7,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,7)=TMat3(7,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,7)=TMat3(7,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,7)=TMat3(7,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,7)=TMat3(7,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,7)=TMat3(7,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,8)=TMat3(7,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,8)=TMat3(7,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,8)=TMat3(7,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,8)=TMat3(7,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,8)=TMat3(7,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,8)=TMat3(7,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,8)=TMat3(7,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,8)=TMat3(7,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,8)=TMat3(7,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,9)=TMat3(7,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,9)=TMat3(7,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,9)=TMat3(7,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,9)=TMat3(7,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,9)=TMat3(7,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,9)=TMat3(7,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,9)=TMat3(7,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,9)=TMat3(7,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,9)=TMat3(7,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,10)=TMat3(7,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,10)=TMat3(7,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,10)=TMat3(7,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,10)=TMat3(7,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,10)=TMat3(7,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,10)=TMat3(7,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,10)=TMat3(7,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,10)=TMat3(7,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,10)=TMat3(7,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,11)=TMat3(7,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,11)=TMat3(7,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,11)=TMat3(7,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,11)=TMat3(7,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,11)=TMat3(7,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,11)=TMat3(7,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,11)=TMat3(7,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,11)=TMat3(7,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,11)=TMat3(7,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,12)=TMat3(7,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,12)=TMat3(7,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,12)=TMat3(7,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,12)=TMat3(7,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,12)=TMat3(7,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,12)=TMat3(7,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,12)=TMat3(7,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,12)=TMat3(7,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,12)=TMat3(7,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,13)=TMat3(7,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,13)=TMat3(7,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,13)=TMat3(7,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,13)=TMat3(7,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,13)=TMat3(7,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,13)=TMat3(7,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,13)=TMat3(7,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,13)=TMat3(7,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,13)=TMat3(7,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,14)=TMat3(7,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,14)=TMat3(7,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,14)=TMat3(7,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,14)=TMat3(7,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,14)=TMat3(7,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,14)=TMat3(7,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,14)=TMat3(7,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,14)=TMat3(7,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,14)=TMat3(7,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,15)=TMat3(7,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,15)=TMat3(7,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,15)=TMat3(7,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,15)=TMat3(7,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,15)=TMat3(7,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,15)=TMat3(7,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,15)=TMat3(7,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,15)=TMat3(7,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,15)=TMat3(7,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIN') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(7,16)=TMat3(7,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(7,16)=TMat3(7,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(7,16)=TMat3(7,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(7,16)=TMat3(7,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(7,16)=TMat3(7,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(7,16)=TMat3(7,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(7,16)=TMat3(7,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(7,16)=TMat3(7,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(7,16)=TMat3(7,16)*TMat2(3,3); end
        
        %*7
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,1)=TMat3(8,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,1)=TMat3(8,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,1)=TMat3(8,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,1)=TMat3(8,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,1)=TMat3(8,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,1)=TMat3(8,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,1)=TMat3(8,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,1)=TMat3(8,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,1)=TMat3(8,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,2)=TMat3(8,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,2)=TMat3(8,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,2)=TMat3(8,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,2)=TMat3(8,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,2)=TMat3(8,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,2)=TMat3(8,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,2)=TMat3(8,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,2)=TMat3(8,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,2)=TMat3(8,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,3)=TMat3(8,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,3)=TMat3(8,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,3)=TMat3(8,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,3)=TMat3(8,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,3)=TMat3(8,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,3)=TMat3(8,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,3)=TMat3(8,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,3)=TMat3(8,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,3)=TMat3(8,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,4)=TMat3(8,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,4)=TMat3(8,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,4)=TMat3(8,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,4)=TMat3(8,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,4)=TMat3(8,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,4)=TMat3(8,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,4)=TMat3(8,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,4)=TMat3(8,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,4)=TMat3(8,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,5)=TMat3(8,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,5)=TMat3(8,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,5)=TMat3(8,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,5)=TMat3(8,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,5)=TMat3(8,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,5)=TMat3(8,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,5)=TMat3(8,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,5)=TMat3(8,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,5)=TMat3(8,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,6)=TMat3(8,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,6)=TMat3(8,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,6)=TMat3(8,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,6)=TMat3(8,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,6)=TMat3(8,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,6)=TMat3(8,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,6)=TMat3(8,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,6)=TMat3(8,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,6)=TMat3(8,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,7)=TMat3(8,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,7)=TMat3(8,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,7)=TMat3(8,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,7)=TMat3(8,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,7)=TMat3(8,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,7)=TMat3(8,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,7)=TMat3(8,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,7)=TMat3(8,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,7)=TMat3(8,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,8)=TMat3(8,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,8)=TMat3(8,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,8)=TMat3(8,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,8)=TMat3(8,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,8)=TMat3(8,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,8)=TMat3(8,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,8)=TMat3(8,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,8)=TMat3(8,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,8)=TMat3(8,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,9)=TMat3(8,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,9)=TMat3(8,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,9)=TMat3(8,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,9)=TMat3(8,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,9)=TMat3(8,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,9)=TMat3(8,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,9)=TMat3(8,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,9)=TMat3(8,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,9)=TMat3(8,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,10)=TMat3(8,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,10)=TMat3(8,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,10)=TMat3(8,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,10)=TMat3(8,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,10)=TMat3(8,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,10)=TMat3(8,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,10)=TMat3(8,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,10)=TMat3(8,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,10)=TMat3(8,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,11)=TMat3(8,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,11)=TMat3(8,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,11)=TMat3(8,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,11)=TMat3(8,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,11)=TMat3(8,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,11)=TMat3(8,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,11)=TMat3(8,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,11)=TMat3(8,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,11)=TMat3(8,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,12)=TMat3(8,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,12)=TMat3(8,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,12)=TMat3(8,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,12)=TMat3(8,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,12)=TMat3(8,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,12)=TMat3(8,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,12)=TMat3(8,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,12)=TMat3(8,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,12)=TMat3(8,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,13)=TMat3(8,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,13)=TMat3(8,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,13)=TMat3(8,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,13)=TMat3(8,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,13)=TMat3(8,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,13)=TMat3(8,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,13)=TMat3(8,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,13)=TMat3(8,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,13)=TMat3(8,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,14)=TMat3(8,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,14)=TMat3(8,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,14)=TMat3(8,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,14)=TMat3(8,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,14)=TMat3(8,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,14)=TMat3(8,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,14)=TMat3(8,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,14)=TMat3(8,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,14)=TMat3(8,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,15)=TMat3(8,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,15)=TMat3(8,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,15)=TMat3(8,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,15)=TMat3(8,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,15)=TMat3(8,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,15)=TMat3(8,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,15)=TMat3(8,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,15)=TMat3(8,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,15)=TMat3(8,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIF') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(8,16)=TMat3(8,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(8,16)=TMat3(8,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(8,16)=TMat3(8,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(8,16)=TMat3(8,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(8,16)=TMat3(8,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(8,16)=TMat3(8,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(8,16)=TMat3(8,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(8,16)=TMat3(8,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(8,16)=TMat3(8,16)*TMat2(3,3); end
        
        %*.8
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,1)=TMat3(9,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,1)=TMat3(9,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,1)=TMat3(9,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,1)=TMat3(9,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,1)=TMat3(9,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,1)=TMat3(9,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,1)=TMat3(9,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,1)=TMat3(9,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,1)=TMat3(9,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,2)=TMat3(9,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,2)=TMat3(9,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,2)=TMat3(9,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,2)=TMat3(9,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,2)=TMat3(9,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,2)=TMat3(9,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,2)=TMat3(9,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,2)=TMat3(9,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,2)=TMat3(9,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,3)=TMat3(9,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,3)=TMat3(9,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,3)=TMat3(9,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,3)=TMat3(9,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,3)=TMat3(9,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,3)=TMat3(9,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,3)=TMat3(9,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,3)=TMat3(9,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,3)=TMat3(9,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,4)=TMat3(9,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,4)=TMat3(9,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,4)=TMat3(9,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,4)=TMat3(9,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,4)=TMat3(9,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,4)=TMat3(9,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,4)=TMat3(9,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,4)=TMat3(9,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,4)=TMat3(9,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,5)=TMat3(9,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,5)=TMat3(9,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,5)=TMat3(9,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,5)=TMat3(9,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,5)=TMat3(9,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,5)=TMat3(9,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,5)=TMat3(9,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,5)=TMat3(9,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,5)=TMat3(9,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,6)=TMat3(9,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,6)=TMat3(9,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,6)=TMat3(9,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,6)=TMat3(9,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,6)=TMat3(9,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,6)=TMat3(9,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,6)=TMat3(9,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,6)=TMat3(9,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,6)=TMat3(9,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,7)=TMat3(9,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,7)=TMat3(9,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,7)=TMat3(9,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,7)=TMat3(9,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,7)=TMat3(9,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,7)=TMat3(9,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,7)=TMat3(9,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,7)=TMat3(9,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,7)=TMat3(9,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,8)=TMat3(9,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,8)=TMat3(9,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,8)=TMat3(9,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,8)=TMat3(9,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,8)=TMat3(9,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,8)=TMat3(9,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,8)=TMat3(9,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,8)=TMat3(9,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,8)=TMat3(9,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,9)=TMat3(9,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,9)=TMat3(9,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,9)=TMat3(9,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,9)=TMat3(9,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,9)=TMat3(9,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,9)=TMat3(9,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,9)=TMat3(9,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,9)=TMat3(9,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,9)=TMat3(9,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,10)=TMat3(9,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,10)=TMat3(9,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,10)=TMat3(9,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,10)=TMat3(9,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,10)=TMat3(9,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,10)=TMat3(9,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,10)=TMat3(9,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,10)=TMat3(9,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,10)=TMat3(9,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,11)=TMat3(9,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,11)=TMat3(9,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,11)=TMat3(9,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,11)=TMat3(9,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,11)=TMat3(9,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,11)=TMat3(9,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,11)=TMat3(9,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,11)=TMat3(9,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,11)=TMat3(9,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,12)=TMat3(9,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,12)=TMat3(9,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,12)=TMat3(9,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,12)=TMat3(9,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,12)=TMat3(9,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,12)=TMat3(9,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,12)=TMat3(9,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,12)=TMat3(9,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,12)=TMat3(9,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,13)=TMat3(9,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,13)=TMat3(9,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,13)=TMat3(9,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,13)=TMat3(9,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,13)=TMat3(9,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,13)=TMat3(9,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,13)=TMat3(9,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,13)=TMat3(9,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,13)=TMat3(9,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,14)=TMat3(9,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,14)=TMat3(9,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,14)=TMat3(9,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,14)=TMat3(9,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,14)=TMat3(9,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,14)=TMat3(9,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,14)=TMat3(9,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,14)=TMat3(9,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,14)=TMat3(9,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,15)=TMat3(9,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,15)=TMat3(9,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,15)=TMat3(9,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,15)=TMat3(9,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,15)=TMat3(9,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,15)=TMat3(9,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,15)=TMat3(9,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,15)=TMat3(9,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,15)=TMat3(9,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BON') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(9,16)=TMat3(9,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(9,16)=TMat3(9,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(9,16)=TMat3(9,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(9,16)=TMat3(9,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(9,16)=TMat3(9,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(9,16)=TMat3(9,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(9,16)=TMat3(9,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(9,16)=TMat3(9,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(9,16)=TMat3(9,16)*TMat2(3,3); end
        
        %*9
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,1)=TMat3(10,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,1)=TMat3(10,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,1)=TMat3(10,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,1)=TMat3(10,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,1)=TMat3(10,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,1)=TMat3(10,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,1)=TMat3(10,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,1)=TMat3(10,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,1)=TMat3(10,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,2)=TMat3(10,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,2)=TMat3(10,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,2)=TMat3(10,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,2)=TMat3(10,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,2)=TMat3(10,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,2)=TMat3(10,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,2)=TMat3(10,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,2)=TMat3(10,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,2)=TMat3(10,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,3)=TMat3(10,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,3)=TMat3(10,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,3)=TMat3(10,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,3)=TMat3(10,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,3)=TMat3(10,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,3)=TMat3(10,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,3)=TMat3(10,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,3)=TMat3(10,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,3)=TMat3(10,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,4)=TMat3(10,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,4)=TMat3(10,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,4)=TMat3(10,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,4)=TMat3(10,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,4)=TMat3(10,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,4)=TMat3(10,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,4)=TMat3(10,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,4)=TMat3(10,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,4)=TMat3(10,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,5)=TMat3(10,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,5)=TMat3(10,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,5)=TMat3(10,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,5)=TMat3(10,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,5)=TMat3(10,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,5)=TMat3(10,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,5)=TMat3(10,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,5)=TMat3(10,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,5)=TMat3(10,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,6)=TMat3(10,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,6)=TMat3(10,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,6)=TMat3(10,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,6)=TMat3(10,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,6)=TMat3(10,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,6)=TMat3(10,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,6)=TMat3(10,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,6)=TMat3(10,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,6)=TMat3(10,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,7)=TMat3(10,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,7)=TMat3(10,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,7)=TMat3(10,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,7)=TMat3(10,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,7)=TMat3(10,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,7)=TMat3(10,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,7)=TMat3(10,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,7)=TMat3(10,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,7)=TMat3(10,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,8)=TMat3(10,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,8)=TMat3(10,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,8)=TMat3(10,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,8)=TMat3(10,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,8)=TMat3(10,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,8)=TMat3(10,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,8)=TMat3(10,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,8)=TMat3(10,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,8)=TMat3(10,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,9)=TMat3(10,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,9)=TMat3(10,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,9)=TMat3(10,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,9)=TMat3(10,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,9)=TMat3(10,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,9)=TMat3(10,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,9)=TMat3(10,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,9)=TMat3(10,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,9)=TMat3(10,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,10)=TMat3(10,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,10)=TMat3(10,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,10)=TMat3(10,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,10)=TMat3(10,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,10)=TMat3(10,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,10)=TMat3(10,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,10)=TMat3(10,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,10)=TMat3(10,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,10)=TMat3(10,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,11)=TMat3(10,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,11)=TMat3(10,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,11)=TMat3(10,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,11)=TMat3(10,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,11)=TMat3(10,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,11)=TMat3(10,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,11)=TMat3(10,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,11)=TMat3(10,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,11)=TMat3(10,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,12)=TMat3(10,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,12)=TMat3(10,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,12)=TMat3(10,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,12)=TMat3(10,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,12)=TMat3(10,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,12)=TMat3(10,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,12)=TMat3(10,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,12)=TMat3(10,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,12)=TMat3(10,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,13)=TMat3(10,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,13)=TMat3(10,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,13)=TMat3(10,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,13)=TMat3(10,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,13)=TMat3(10,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,13)=TMat3(10,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,13)=TMat3(10,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,13)=TMat3(10,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,13)=TMat3(10,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,14)=TMat3(10,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,14)=TMat3(10,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,14)=TMat3(10,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,14)=TMat3(10,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,14)=TMat3(10,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,14)=TMat3(10,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,14)=TMat3(10,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,14)=TMat3(10,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,14)=TMat3(10,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,15)=TMat3(10,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,15)=TMat3(10,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,15)=TMat3(10,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,15)=TMat3(10,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,15)=TMat3(10,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,15)=TMat3(10,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,15)=TMat3(10,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,15)=TMat3(10,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,15)=TMat3(10,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOF') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(10,16)=TMat3(10,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(10,16)=TMat3(10,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(10,16)=TMat3(10,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(10,16)=TMat3(10,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(10,16)=TMat3(10,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(10,16)=TMat3(10,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(10,16)=TMat3(10,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(10,16)=TMat3(10,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(10,16)=TMat3(10,16)*TMat2(3,3); end
        
        %10
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,1)=TMat3(11,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,1)=TMat3(11,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,1)=TMat3(11,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,1)=TMat3(11,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,1)=TMat3(11,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,1)=TMat3(11,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,1)=TMat3(11,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,1)=TMat3(11,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,1)=TMat3(11,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,2)=TMat3(11,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,2)=TMat3(11,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,2)=TMat3(11,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,2)=TMat3(11,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,2)=TMat3(11,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,2)=TMat3(11,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,2)=TMat3(11,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,2)=TMat3(11,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,2)=TMat3(11,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,3)=TMat3(11,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,3)=TMat3(11,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,3)=TMat3(11,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,3)=TMat3(11,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,3)=TMat3(11,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,3)=TMat3(11,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,3)=TMat3(11,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,3)=TMat3(11,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,3)=TMat3(11,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,4)=TMat3(11,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,4)=TMat3(11,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,4)=TMat3(11,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,4)=TMat3(11,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,4)=TMat3(11,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,4)=TMat3(11,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,4)=TMat3(11,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,4)=TMat3(11,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,4)=TMat3(11,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,5)=TMat3(11,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,5)=TMat3(11,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,5)=TMat3(11,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,5)=TMat3(11,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,5)=TMat3(11,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,5)=TMat3(11,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,5)=TMat3(11,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,5)=TMat3(11,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,5)=TMat3(11,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,6)=TMat3(11,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,6)=TMat3(11,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,6)=TMat3(11,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,6)=TMat3(11,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,6)=TMat3(11,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,6)=TMat3(11,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,6)=TMat3(11,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,6)=TMat3(11,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,6)=TMat3(11,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,7)=TMat3(11,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,7)=TMat3(11,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,7)=TMat3(11,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,7)=TMat3(11,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,7)=TMat3(11,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,7)=TMat3(11,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,7)=TMat3(11,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,7)=TMat3(11,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,7)=TMat3(11,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,8)=TMat3(11,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,8)=TMat3(11,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,8)=TMat3(11,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,8)=TMat3(11,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,8)=TMat3(11,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,8)=TMat3(11,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,8)=TMat3(11,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,8)=TMat3(11,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,8)=TMat3(11,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,9)=TMat3(11,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,9)=TMat3(11,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,9)=TMat3(11,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,9)=TMat3(11,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,9)=TMat3(11,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,9)=TMat3(11,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,9)=TMat3(11,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,9)=TMat3(11,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,9)=TMat3(11,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,10)=TMat3(11,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,10)=TMat3(11,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,10)=TMat3(11,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,10)=TMat3(11,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,10)=TMat3(11,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,10)=TMat3(11,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,10)=TMat3(11,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,10)=TMat3(11,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,10)=TMat3(11,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,11)=TMat3(11,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,11)=TMat3(11,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,11)=TMat3(11,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,11)=TMat3(11,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,11)=TMat3(11,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,11)=TMat3(11,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,11)=TMat3(11,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,11)=TMat3(11,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,11)=TMat3(11,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,12)=TMat3(11,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,12)=TMat3(11,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,12)=TMat3(11,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,12)=TMat3(11,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,12)=TMat3(11,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,12)=TMat3(11,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,12)=TMat3(11,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,12)=TMat3(11,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,12)=TMat3(11,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,13)=TMat3(11,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,13)=TMat3(11,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,13)=TMat3(11,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,13)=TMat3(11,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,13)=TMat3(11,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,13)=TMat3(11,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,13)=TMat3(11,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,13)=TMat3(11,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,13)=TMat3(11,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,14)=TMat3(11,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,14)=TMat3(11,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,14)=TMat3(11,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,14)=TMat3(11,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,14)=TMat3(11,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,14)=TMat3(11,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,14)=TMat3(11,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,14)=TMat3(11,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,14)=TMat3(11,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,15)=TMat3(11,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,15)=TMat3(11,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,15)=TMat3(11,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,15)=TMat3(11,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,15)=TMat3(11,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,15)=TMat3(11,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,15)=TMat3(11,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,15)=TMat3(11,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,15)=TMat3(11,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSL') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(11,16)=TMat3(11,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(11,16)=TMat3(11,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(11,16)=TMat3(11,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(11,16)=TMat3(11,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(11,16)=TMat3(11,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(11,16)=TMat3(11,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(11,16)=TMat3(11,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(11,16)=TMat3(11,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(11,16)=TMat3(11,16)*TMat2(3,3); end
        
        %11
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,1)=TMat3(12,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,1)=TMat3(12,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,1)=TMat3(12,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,1)=TMat3(12,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,1)=TMat3(12,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,1)=TMat3(12,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,1)=TMat3(12,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,1)=TMat3(12,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,1)=TMat3(12,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,2)=TMat3(12,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,2)=TMat3(12,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,2)=TMat3(12,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,2)=TMat3(12,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,2)=TMat3(12,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,2)=TMat3(12,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,2)=TMat3(12,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,2)=TMat3(12,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,2)=TMat3(12,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,3)=TMat3(12,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,3)=TMat3(12,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,3)=TMat3(12,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,3)=TMat3(12,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,3)=TMat3(12,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,3)=TMat3(12,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,3)=TMat3(12,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,3)=TMat3(12,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,3)=TMat3(12,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,4)=TMat3(12,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,4)=TMat3(12,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,4)=TMat3(12,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,4)=TMat3(12,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,4)=TMat3(12,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,4)=TMat3(12,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,4)=TMat3(12,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,4)=TMat3(12,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,4)=TMat3(12,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,5)=TMat3(12,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,5)=TMat3(12,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,5)=TMat3(12,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,5)=TMat3(12,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,5)=TMat3(12,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,5)=TMat3(12,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,5)=TMat3(12,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,5)=TMat3(12,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,5)=TMat3(12,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,6)=TMat3(12,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,6)=TMat3(12,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,6)=TMat3(12,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,6)=TMat3(12,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,6)=TMat3(12,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,6)=TMat3(12,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,6)=TMat3(12,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,6)=TMat3(12,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,6)=TMat3(12,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,7)=TMat3(12,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,7)=TMat3(12,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,7)=TMat3(12,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,7)=TMat3(12,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,7)=TMat3(12,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,7)=TMat3(12,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,7)=TMat3(12,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,7)=TMat3(12,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,7)=TMat3(12,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,8)=TMat3(12,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,8)=TMat3(12,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,8)=TMat3(12,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,8)=TMat3(12,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,8)=TMat3(12,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,8)=TMat3(12,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,8)=TMat3(12,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,8)=TMat3(12,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,8)=TMat3(12,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,9)=TMat3(12,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,9)=TMat3(12,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,9)=TMat3(12,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,9)=TMat3(12,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,9)=TMat3(12,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,9)=TMat3(12,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,9)=TMat3(12,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,9)=TMat3(12,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,9)=TMat3(12,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,10)=TMat3(12,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,10)=TMat3(12,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,10)=TMat3(12,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,10)=TMat3(12,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,10)=TMat3(12,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,10)=TMat3(12,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,10)=TMat3(12,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,10)=TMat3(12,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,10)=TMat3(12,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,11)=TMat3(12,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,11)=TMat3(12,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,11)=TMat3(12,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,11)=TMat3(12,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,11)=TMat3(12,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,11)=TMat3(12,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,11)=TMat3(12,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,11)=TMat3(12,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,11)=TMat3(12,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,12)=TMat3(12,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,12)=TMat3(12,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,12)=TMat3(12,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,12)=TMat3(12,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,12)=TMat3(12,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,12)=TMat3(12,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,12)=TMat3(12,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,12)=TMat3(12,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,12)=TMat3(12,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,13)=TMat3(12,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,13)=TMat3(12,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,13)=TMat3(12,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,13)=TMat3(12,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,13)=TMat3(12,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,13)=TMat3(12,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,13)=TMat3(12,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,13)=TMat3(12,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,13)=TMat3(12,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,14)=TMat3(12,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,14)=TMat3(12,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,14)=TMat3(12,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,14)=TMat3(12,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,14)=TMat3(12,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,14)=TMat3(12,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,14)=TMat3(12,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,14)=TMat3(12,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,14)=TMat3(12,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,15)=TMat3(12,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,15)=TMat3(12,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,15)=TMat3(12,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,15)=TMat3(12,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,15)=TMat3(12,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,15)=TMat3(12,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,15)=TMat3(12,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,15)=TMat3(12,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,15)=TMat3(12,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSL') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(12,16)=TMat3(12,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(12,16)=TMat3(12,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(12,16)=TMat3(12,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(12,16)=TMat3(12,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(12,16)=TMat3(12,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(12,16)=TMat3(12,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(12,16)=TMat3(12,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(12,16)=TMat3(12,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(12,16)=TMat3(12,16)*TMat2(3,3); end
        
        %12
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,1)=TMat3(13,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,1)=TMat3(13,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,1)=TMat3(13,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,1)=TMat3(13,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,1)=TMat3(13,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,1)=TMat3(13,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,1)=TMat3(13,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,1)=TMat3(13,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,1)=TMat3(13,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,2)=TMat3(13,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,2)=TMat3(13,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,2)=TMat3(13,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,2)=TMat3(13,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,2)=TMat3(13,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,2)=TMat3(13,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,2)=TMat3(13,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,2)=TMat3(13,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,2)=TMat3(13,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,3)=TMat3(13,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,3)=TMat3(13,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,3)=TMat3(13,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,3)=TMat3(13,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,3)=TMat3(13,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,3)=TMat3(13,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,3)=TMat3(13,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,3)=TMat3(13,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,3)=TMat3(13,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,4)=TMat3(13,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,4)=TMat3(13,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,4)=TMat3(13,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,4)=TMat3(13,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,4)=TMat3(13,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,4)=TMat3(13,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,4)=TMat3(13,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,4)=TMat3(13,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,4)=TMat3(13,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,5)=TMat3(13,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,5)=TMat3(13,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,5)=TMat3(13,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,5)=TMat3(13,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,5)=TMat3(13,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,5)=TMat3(13,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,5)=TMat3(13,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,5)=TMat3(13,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,5)=TMat3(13,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,6)=TMat3(13,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,6)=TMat3(13,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,6)=TMat3(13,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,6)=TMat3(13,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,6)=TMat3(13,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,6)=TMat3(13,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,6)=TMat3(13,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,6)=TMat3(13,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,6)=TMat3(13,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,7)=TMat3(13,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,7)=TMat3(13,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,7)=TMat3(13,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,7)=TMat3(13,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,7)=TMat3(13,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,7)=TMat3(13,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,7)=TMat3(13,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,7)=TMat3(13,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,7)=TMat3(13,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,8)=TMat3(13,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,8)=TMat3(13,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,8)=TMat3(13,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,8)=TMat3(13,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,8)=TMat3(13,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,8)=TMat3(13,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,8)=TMat3(13,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,8)=TMat3(13,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,8)=TMat3(13,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,9)=TMat3(13,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,9)=TMat3(13,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,9)=TMat3(13,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,9)=TMat3(13,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,9)=TMat3(13,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,9)=TMat3(13,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,9)=TMat3(13,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,9)=TMat3(13,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,9)=TMat3(13,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,10)=TMat3(13,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,10)=TMat3(13,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,10)=TMat3(13,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,10)=TMat3(13,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,10)=TMat3(13,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,10)=TMat3(13,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,10)=TMat3(13,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,10)=TMat3(13,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,10)=TMat3(13,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,11)=TMat3(13,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,11)=TMat3(13,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,11)=TMat3(13,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,11)=TMat3(13,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,11)=TMat3(13,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,11)=TMat3(13,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,11)=TMat3(13,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,11)=TMat3(13,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,11)=TMat3(13,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,12)=TMat3(13,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,12)=TMat3(13,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,12)=TMat3(13,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,12)=TMat3(13,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,12)=TMat3(13,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,12)=TMat3(13,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,12)=TMat3(13,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,12)=TMat3(13,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,12)=TMat3(13,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,13)=TMat3(13,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,13)=TMat3(13,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,13)=TMat3(13,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,13)=TMat3(13,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,13)=TMat3(13,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,13)=TMat3(13,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,13)=TMat3(13,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,13)=TMat3(13,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,13)=TMat3(13,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,14)=TMat3(13,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,14)=TMat3(13,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,14)=TMat3(13,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,14)=TMat3(13,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,14)=TMat3(13,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,14)=TMat3(13,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,14)=TMat3(13,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,14)=TMat3(13,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,14)=TMat3(13,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,15)=TMat3(13,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,15)=TMat3(13,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,15)=TMat3(13,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,15)=TMat3(13,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,15)=TMat3(13,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,15)=TMat3(13,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,15)=TMat3(13,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,15)=TMat3(13,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,15)=TMat3(13,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BINSR') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(13,16)=TMat3(13,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(13,16)=TMat3(13,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(13,16)=TMat3(13,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(13,16)=TMat3(13,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(13,16)=TMat3(13,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(13,16)=TMat3(13,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(13,16)=TMat3(13,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(13,16)=TMat3(13,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(13,16)=TMat3(13,16)*TMat2(3,3); end
        
        %13
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,1)=TMat3(14,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,1)=TMat3(14,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,1)=TMat3(14,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,1)=TMat3(14,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,1)=TMat3(14,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,1)=TMat3(14,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,1)=TMat3(14,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,1)=TMat3(14,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,1)=TMat3(14,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,2)=TMat3(14,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,2)=TMat3(14,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,2)=TMat3(14,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,2)=TMat3(14,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,2)=TMat3(14,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,2)=TMat3(14,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,2)=TMat3(14,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,2)=TMat3(14,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,2)=TMat3(14,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,3)=TMat3(14,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,3)=TMat3(14,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,3)=TMat3(14,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,3)=TMat3(14,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,3)=TMat3(14,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,3)=TMat3(14,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,3)=TMat3(14,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,3)=TMat3(14,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,3)=TMat3(14,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,4)=TMat3(14,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,4)=TMat3(14,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,4)=TMat3(14,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,4)=TMat3(14,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,4)=TMat3(14,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,4)=TMat3(14,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,4)=TMat3(14,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,4)=TMat3(14,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,4)=TMat3(14,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,5)=TMat3(14,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,5)=TMat3(14,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,5)=TMat3(14,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,5)=TMat3(14,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,5)=TMat3(14,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,5)=TMat3(14,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,5)=TMat3(14,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,5)=TMat3(14,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,5)=TMat3(14,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,6)=TMat3(14,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,6)=TMat3(14,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,6)=TMat3(14,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,6)=TMat3(14,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,6)=TMat3(14,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,6)=TMat3(14,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,6)=TMat3(14,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,6)=TMat3(14,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,6)=TMat3(14,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,7)=TMat3(14,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,7)=TMat3(14,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,7)=TMat3(14,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,7)=TMat3(14,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,7)=TMat3(14,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,7)=TMat3(14,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,7)=TMat3(14,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,7)=TMat3(14,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,7)=TMat3(14,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,8)=TMat3(14,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,8)=TMat3(14,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,8)=TMat3(14,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,8)=TMat3(14,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,8)=TMat3(14,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,8)=TMat3(14,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,8)=TMat3(14,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,8)=TMat3(14,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,8)=TMat3(14,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,9)=TMat3(14,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,9)=TMat3(14,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,9)=TMat3(14,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,9)=TMat3(14,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,9)=TMat3(14,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,9)=TMat3(14,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,9)=TMat3(14,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,9)=TMat3(14,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,9)=TMat3(14,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,10)=TMat3(14,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,10)=TMat3(14,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,10)=TMat3(14,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,10)=TMat3(14,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,10)=TMat3(14,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,10)=TMat3(14,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,10)=TMat3(14,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,10)=TMat3(14,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,10)=TMat3(14,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,11)=TMat3(14,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,11)=TMat3(14,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,11)=TMat3(14,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,11)=TMat3(14,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,11)=TMat3(14,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,11)=TMat3(14,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,11)=TMat3(14,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,11)=TMat3(14,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,11)=TMat3(14,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,12)=TMat3(14,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,12)=TMat3(14,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,12)=TMat3(14,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,12)=TMat3(14,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,12)=TMat3(14,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,12)=TMat3(14,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,12)=TMat3(14,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,12)=TMat3(14,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,12)=TMat3(14,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,13)=TMat3(14,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,13)=TMat3(14,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,13)=TMat3(14,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,13)=TMat3(14,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,13)=TMat3(14,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,13)=TMat3(14,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,13)=TMat3(14,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,13)=TMat3(14,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,13)=TMat3(14,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,14)=TMat3(14,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,14)=TMat3(14,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,14)=TMat3(14,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,14)=TMat3(14,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,14)=TMat3(14,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,14)=TMat3(14,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,14)=TMat3(14,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,14)=TMat3(14,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,14)=TMat3(14,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,15)=TMat3(14,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,15)=TMat3(14,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,15)=TMat3(14,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,15)=TMat3(14,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,15)=TMat3(14,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,15)=TMat3(14,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,15)=TMat3(14,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,15)=TMat3(14,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,15)=TMat3(14,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BIFSR') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(14,16)=TMat3(14,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(14,16)=TMat3(14,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(14,16)=TMat3(14,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(14,16)=TMat3(14,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(14,16)=TMat3(14,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(14,16)=TMat3(14,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(14,16)=TMat3(14,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(14,16)=TMat3(14,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(14,16)=TMat3(14,16)*TMat2(3,3); end
        
        %14
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,1)=TMat3(15,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,1)=TMat3(15,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,1)=TMat3(15,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,1)=TMat3(15,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,1)=TMat3(15,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,1)=TMat3(15,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,1)=TMat3(15,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,1)=TMat3(15,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,1)=TMat3(15,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,2)=TMat3(15,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,2)=TMat3(15,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,2)=TMat3(15,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,2)=TMat3(15,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,2)=TMat3(15,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,2)=TMat3(15,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,2)=TMat3(15,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,2)=TMat3(15,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,2)=TMat3(15,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,3)=TMat3(15,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,3)=TMat3(15,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,3)=TMat3(15,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,3)=TMat3(15,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,3)=TMat3(15,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,3)=TMat3(15,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,3)=TMat3(15,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,3)=TMat3(15,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,3)=TMat3(15,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,4)=TMat3(15,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,4)=TMat3(15,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,4)=TMat3(15,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,4)=TMat3(15,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,4)=TMat3(15,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,4)=TMat3(15,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,4)=TMat3(15,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,4)=TMat3(15,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,4)=TMat3(15,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,5)=TMat3(15,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,5)=TMat3(15,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,5)=TMat3(15,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,5)=TMat3(15,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,5)=TMat3(15,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,5)=TMat3(15,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,5)=TMat3(15,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,5)=TMat3(15,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,5)=TMat3(15,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,6)=TMat3(15,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,6)=TMat3(15,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,6)=TMat3(15,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,6)=TMat3(15,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,6)=TMat3(15,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,6)=TMat3(15,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,6)=TMat3(15,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,6)=TMat3(15,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,6)=TMat3(15,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,7)=TMat3(15,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,7)=TMat3(15,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,7)=TMat3(15,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,7)=TMat3(15,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,7)=TMat3(15,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,7)=TMat3(15,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,7)=TMat3(15,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,7)=TMat3(15,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,7)=TMat3(15,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,8)=TMat3(15,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,8)=TMat3(15,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,8)=TMat3(15,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,8)=TMat3(15,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,8)=TMat3(15,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,8)=TMat3(15,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,8)=TMat3(15,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,8)=TMat3(15,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,8)=TMat3(15,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,9)=TMat3(15,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,9)=TMat3(15,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,9)=TMat3(15,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,9)=TMat3(15,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,9)=TMat3(15,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,9)=TMat3(15,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,9)=TMat3(15,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,9)=TMat3(15,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,9)=TMat3(15,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,10)=TMat3(15,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,10)=TMat3(15,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,10)=TMat3(15,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,10)=TMat3(15,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,10)=TMat3(15,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,10)=TMat3(15,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,10)=TMat3(15,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,10)=TMat3(15,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,10)=TMat3(15,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,11)=TMat3(15,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,11)=TMat3(15,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,11)=TMat3(15,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,11)=TMat3(15,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,11)=TMat3(15,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,11)=TMat3(15,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,11)=TMat3(15,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,11)=TMat3(15,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,11)=TMat3(15,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,12)=TMat3(15,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,12)=TMat3(15,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,12)=TMat3(15,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,12)=TMat3(15,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,12)=TMat3(15,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,12)=TMat3(15,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,12)=TMat3(15,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,12)=TMat3(15,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,12)=TMat3(15,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,13)=TMat3(15,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,13)=TMat3(15,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,13)=TMat3(15,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,13)=TMat3(15,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,13)=TMat3(15,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,13)=TMat3(15,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,13)=TMat3(15,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,13)=TMat3(15,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,13)=TMat3(15,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,14)=TMat3(15,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,14)=TMat3(15,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,14)=TMat3(15,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,14)=TMat3(15,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,14)=TMat3(15,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,14)=TMat3(15,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,14)=TMat3(15,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,14)=TMat3(15,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,14)=TMat3(15,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,15)=TMat3(15,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,15)=TMat3(15,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,15)=TMat3(15,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,15)=TMat3(15,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,15)=TMat3(15,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,15)=TMat3(15,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,15)=TMat3(15,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,15)=TMat3(15,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,15)=TMat3(15,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BOFS') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(15,16)=TMat3(15,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(15,16)=TMat3(15,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(15,16)=TMat3(15,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(15,16)=TMat3(15,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(15,16)=TMat3(15,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(15,16)=TMat3(15,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(15,16)=TMat3(15,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(15,16)=TMat3(15,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(15,16)=TMat3(15,16)*TMat2(3,3); end
        
        %15
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'SFL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,1)=TMat3(16,1)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,1)=TMat3(16,1)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,1)=TMat3(16,1)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,1)=TMat3(16,1)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,1)=TMat3(16,1)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,1)=TMat3(16,1)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,1)=TMat3(16,1)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,1)=TMat3(16,1)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,1)=TMat3(16,1)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'SFR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,2)=TMat3(16,2)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,2)=TMat3(16,2)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,2)=TMat3(16,2)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,2)=TMat3(16,2)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,2)=TMat3(16,2)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,2)=TMat3(16,2)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,2)=TMat3(16,2)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,2)=TMat3(16,2)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,2)=TMat3(16,2)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'SNL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,3)=TMat3(16,3)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,3)=TMat3(16,3)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,3)=TMat3(16,3)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,3)=TMat3(16,3)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,3)=TMat3(16,3)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,3)=TMat3(16,3)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,3)=TMat3(16,3)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,3)=TMat3(16,3)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,3)=TMat3(16,3)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'SNR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,4)=TMat3(16,4)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,4)=TMat3(16,4)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,4)=TMat3(16,4)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,4)=TMat3(16,4)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,4)=TMat3(16,4)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,4)=TMat3(16,4)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,4)=TMat3(16,4)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,4)=TMat3(16,4)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,4)=TMat3(16,4)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'HF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,5)=TMat3(16,5)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,5)=TMat3(16,5)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,5)=TMat3(16,5)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,5)=TMat3(16,5)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,5)=TMat3(16,5)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,5)=TMat3(16,5)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,5)=TMat3(16,5)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,5)=TMat3(16,5)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,5)=TMat3(16,5)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'HN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,6)=TMat3(16,6)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,6)=TMat3(16,6)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,6)=TMat3(16,6)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,6)=TMat3(16,6)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,6)=TMat3(16,6)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,6)=TMat3(16,6)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,6)=TMat3(16,6)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,6)=TMat3(16,6)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,6)=TMat3(16,6)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BIN')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,7)=TMat3(16,7)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,7)=TMat3(16,7)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,7)=TMat3(16,7)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,7)=TMat3(16,7)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,7)=TMat3(16,7)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,7)=TMat3(16,7)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,7)=TMat3(16,7)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,7)=TMat3(16,7)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,7)=TMat3(16,7)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BIF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,8)=TMat3(16,8)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,8)=TMat3(16,8)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,8)=TMat3(16,8)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,8)=TMat3(16,8)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,8)=TMat3(16,8)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,8)=TMat3(16,8)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,8)=TMat3(16,8)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,8)=TMat3(16,8)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,8)=TMat3(16,8)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BON')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,9)=TMat3(16,9)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,9)=TMat3(16,9)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,9)=TMat3(16,9)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,9)=TMat3(16,9)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,9)=TMat3(16,9)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,9)=TMat3(16,9)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,9)=TMat3(16,9)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,9)=TMat3(16,9)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,9)=TMat3(16,9)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BOF')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,10)=TMat3(16,10)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,10)=TMat3(16,10)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,10)=TMat3(16,10)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,10)=TMat3(16,10)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,10)=TMat3(16,10)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,10)=TMat3(16,10)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,10)=TMat3(16,10)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,10)=TMat3(16,10)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,10)=TMat3(16,10)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BINSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,11)=TMat3(16,11)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,11)=TMat3(16,11)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,11)=TMat3(16,11)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,11)=TMat3(16,11)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,11)=TMat3(16,11)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,11)=TMat3(16,11)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,11)=TMat3(16,11)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,11)=TMat3(16,11)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,11)=TMat3(16,11)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BIFSL')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,12)=TMat3(16,12)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,12)=TMat3(16,12)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,12)=TMat3(16,12)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,12)=TMat3(16,12)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,12)=TMat3(16,12)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,12)=TMat3(16,12)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,12)=TMat3(16,12)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,12)=TMat3(16,12)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,12)=TMat3(16,12)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BINSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,13)=TMat3(16,13)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,13)=TMat3(16,13)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,13)=TMat3(16,13)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,13)=TMat3(16,13)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,13)=TMat3(16,13)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,13)=TMat3(16,13)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,13)=TMat3(16,13)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,13)=TMat3(16,13)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,13)=TMat3(16,13)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BIFSR')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,14)=TMat3(16,14)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,14)=TMat3(16,14)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,14)=TMat3(16,14)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,14)=TMat3(16,14)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,14)=TMat3(16,14)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,14)=TMat3(16,14)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,14)=TMat3(16,14)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,14)=TMat3(16,14)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,14)=TMat3(16,14)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BOFS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,15)=TMat3(16,15)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,15)=TMat3(16,15)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,15)=TMat3(16,15)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,15)=TMat3(16,15)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,15)=TMat3(16,15)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,15)=TMat3(16,15)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,15)=TMat3(16,15)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,15)=TMat3(16,15)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,15)=TMat3(16,15)*TMat2(3,3); end
        
    elseif strcmp(Seq{i},'BONS') && strcmp(Seq{i+1},'BONS')
        if strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'S'), New_Topology(16,16)=TMat3(16,16)*TMat2(1,1); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'H'), New_Topology(16,16)=TMat3(16,16)*TMat2(1,2); elseif strcmp(Seq2(i),'S') && strcmp(Seq2(i+1),'B'),New_Topology(16,16)=TMat3(16,16)*TMat2(1,3); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'S'), New_Topology(16,16)=TMat3(16,16)*TMat2(2,1); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'H'), New_Topology(16,16)=TMat3(16,16)*TMat2(2,2); elseif strcmp(Seq2(i),'H') && strcmp(Seq2(i+1),'B'), New_Topology(16,16)=TMat3(16,16)*TMat2(2,3); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'S'), New_Topology(16,16)=TMat3(16,16)*TMat2(3,1); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'H'), New_Topology(16,16)=TMat3(16,16)*TMat2(3,2); elseif strcmp(Seq2(i),'B') && strcmp(Seq2(i+1),'B'), New_Topology(16,16)=TMat3(16,16)*TMat2(3,3); end
        %16
        
        
    end
end

%new topology has the hierarchial input to it


LH = log(prod(New_Topology(New_Topology>0)));
TMatrix = New_Topology;




% C(1:4,1:4)=TMat3(1:4,1:4)*TMat2(1,1);
% C(1:4,5:6)=TMat3(1:4,5:6)*TMat2(1,2);
% C(1:4,7:16)=TMat3(1:4,7:16)*TMat2(1,3);
% C(5:6,1:4)=TMat3(5:6,1:4)*TMat2(2,1);
% C(5:6,5:6)=TMat3(5:6,5:6)*TMat2(2,2);
% C(5:6,7:16)=TMat3(5:6,7:16)*TMat2(2,3);
% C(7:16,7:16)=TMat3(7:16,7:16)*TMat2(3,3);
% C(7:16,1:4)=TMat3(7:16,1:4)*TMat2(3,1);
% C(7:16,5:6)=TMat3(7:16,5:6)*TMat2(3,2);



