clear all

%get some system
s = tf('s');
G = 1/(s*(s+3)*(s+6));

%get root locust data
[rldata, k_list] = rlocus(G, 0.01, 0, 40);

%define some controler
Z_CI=4.52921067560045;
G_pd = (s+Z_CI);

%get root locust data
[rldata_pd k_list_pd] = rlocus(G_pd*G, 0.01, 0, 40);

%the plot is discontinuous
rldata_pd(1,2627:2628)
rldata_pd(2,2627:2628)

%take care of it
tmp = rldata_pd(1,2628:length(rldata_pd(1,:)));
rldata_pd(1,2628:length(rldata_pd(1,:))) = rldata_pd(2,2628:length(rldata_pd(1,:)));
rldata_pd(2,2628:length(rldata_pd(1,:))) = tmp;


