% Script e12 Root locus for a system with real poles
clear % removes all variables from the workspace
disp('Create zero and pole arrays of G(s)')
  zOL = -5 % open-loop zero
  pOL = [ -1; -3; -12 ] % open-loop poles
  pause
  G = zpk(zOL,pOL,1) %Create G(s) as a ZP object with gain K=1
  pause;  disp('>>> Next, draw root-locus plot with default area')
  rlocus(G);   grid; title('Root Locus with default area')
  pause
  disp('Redraw root-locus plot with smaller area ')
  axis equal
  axis([-10 10 -10 10]);
  title('Root Locus with smaller area')
  %keyboard
  disp('Use mouse or arrow keys to select ')
  disp('a point on the locus that will appear.')
  disp('To repeat, enter the command')
  disp('      [kk,clroots] = rlocfind(G)')
  [kk,clroots] = rlocfind(G)
 % keyboard