%% Closed-Loop Pole Locations for a Set of Feedback Gain Values
% For this example, consider the following SISO transfer function model:
% sys(s) = \frac{0.5s^2-1}{4s^4+3s^2+2}
%  Define the transfer function model and required vector of feedback gain values. For this example, consider a set of gain values varying from 1 to 8 with increments of 0.5 and extract the closed-loop pole locations using rlocus.

sys = tf([0.5 -1],[4 0 3 0 2]);
k = (1:0.5:5);
r = rlocus(sys,k);
size(r)

% Since sys contains 4 closed-loop poles, the size of the resultant array of closed-pole locations r is 4x9 where the 9 columns correspond to the 9 specific gain values defined in k.
% You can also visualize the trajectory of the closed-loop poles for the specific gain values in k on the root locus plot.

rlocus(sys,k)

% Copyright 2019 The MathWorks, Inc.