%% Nichols Plot of Model with Complex Coefficients
% Create a Nichols plot of a model with complex coefficients and a model with real coefficients on the same plot.

rng(0)
A = [-3.50,-1.25-0.25i;2,0];
B = [1;0];
C = [-0.75-0.5i,0.625-0.125i];
D = 0.5;
Gc = ss(A,B,C,D);
Gr = rss(7);
nichols(Gc,Gr)
legend('Complex-coefficient model','Real-coefficient model','Location','southwest')

% For models with complex coefficients, nichols shows a contour comprised of both positive and negative frequencies. For models with real coefficients, the plot shows only positive frequencies, even when complex-coefficient models are present. You can click the curve to further examine which section and values correspond to positive and negative frequencies.
% Copyright 2021 The MathWorks, Inc.