% Script e4 Responses due to distinct poles
  clear % removes all variables from the workspace
  numG = [3 2]  % Create numerator
  denG = [2 4 5 1] % … & denominator polynomials
  G = tf(numG,denG) % create TF object
  pause
  [resG,polG,otherG] = residue(numG,denG) %Do partial-fraction
 % expansion to get residues at each pole)
  pause
  t = [0:0.1:20];
  ycmplx = cpole2t(polG(1),resG(1),t); %response due to complex poles
  yreal = rpole2t(polG(3),resG(3),t); %response due to real pole
  ytot = ycmplx + yreal;
  plot(t,ytot,t,ycmplx,t,yreal,'--');grid
  title('Ex 4: responses: total, & from complex & real poles')
  legend('total','complex poles','real pole')
  
