% % code12.m -- quadratic roots (djm - 10 oct 01) % pert = -0.5:0.02:0.5; cmap = colormap; clf; hold on % find & plot roots for j = 1:size(pert,2) y = roots([1-pert(j) -2 1]); col = cmap(j,:); plot(real(y(1)),imag(y(1)),'x','color',col) plot(real(y(2)),imag(y(2)),'x','color',col) end axis square title('\bf root locus') xlabel('\bf real part') ylabel('\bf imag part')