MATLAB: How to create a root locus plot with additionally highlighted poles for certain gain factors using RLOCUS or RLOCUSPLOT

addcertainControl System Toolboxdisplaygainhilitelocusmarkpolepolesrootroot locusspecific

I am creating root locus plots using RLOCUSPLOT and I want to emphasize the poles for a certain gain in my plot. I know it is possible to pass a gain vector as third parameter of RLOCUSPLOT but this does not lead to the desired result.
rlocusplot(tf([1 2],[1 2 1]))
hold on
rlocusplot(tf([1 2],[1 2 1]), 1);
How can I create the root locus plot with additionally highlighted poles for a certain gain factor?

Best Answer

The following example uses RLOCUSPLOT to create the complete root locus. In the second step RLOCUS calculates the poles for gain value k=1. Finally the the poles are plotted into the existing root locus plot using red marker "x":
rlocusplot(tf([1 2],[1 2 1]))
hold on
pole=rlocus(tf([1 2],[1 2 1]), 1);
plot(real(pole),imag(pole),'rx','Markersize',10)
hold off
You can adjust the appearance of the highlighted poles according to your preference. For further information refer to the LineSpec documentation:
docsearch('linespec')