%  Feedback Control of Dynamic Systems, 8e 
%                   Franklin, Powell, Emami
% example 0 demo example
%

clf

s=tf('s');

sysL1 = (s+1)/((s^2+4*s+8));  
rlocus(sysL1);    % roots vs. K
axis([-6 1 -3 3])
hold on

K = 5
fn = [1 4+K (8+K)]
rt = roots( fn )

R1 = rlocus( sysL1, K );  % plot roots with KT = 1
plot(R1+j*0.0001,'s', 'MarkerSize', 10, 'MarkerFaceColor','k')
axis([-6 1 -3 3])

%plot(R1,'*')

title('Root Locus vs. K')
%grid on
%hold off


set(gco,'LineWidth',2)