% Script e9 Trnasfer function of complex multi block system
  clear % removes all variables from the workspace
  G1 = tf([1],[1 10]);  
  G2 = tf([1],[1 1]);
  G3 = tf([1 0 1],[1 4 4]);
  G4 = tf([1 1],[1 6]);
  H1 = tf([1 1],[1 2]);
  H2 = tf([2],[1]);
  H3 = tf([1],[1]); % up to here STEP 1
  sys1 = H2/G4;  % STEP 2
  sys2 = series(G3, G4);
  sys3 = feedback(sys2, H1,+1);  % STEP 3
  sys4 = series(G2, sys3);
  sys5 = feedback(sys4, sys1); % STEP 4
  sys6= series(G1, sys5);
  G = feedback(sys6, H3) % STEP 5
  
