Nichols grid

% If you want to use this m-file regularly do draw Nichols Charts
% it is advisible to make it into an m-file of type “function”.

% — Draw the Nichols grid
xmin = -360; xmax = 0; ymin=-20; ymax=20;
margins =[xmin xmax ymin ymax];
ha=axis(margins);
degs =xmin:5:xmax;
dbs  = ymin:0.5:ymax;
[DEG, DB] = meshgrid(degs, dbs);
ol    = 10.^(DB/20)                  …
.*exp(sqrt(-1)*DEG*pi/180);      % open loop, numerical value
cl    = ol./(1+ol);                    % closed loop, numerical
cldb  = 20*log10(abs(cl));             % closed loop, decibel
vals  = [-12 -6 0 6 12];               % values to plot

% — plot the M-circles
contour(DEG,DB,cldb,vals);
% — plot tics and rectangular grid
xticks=xmin:45:xmax;                   % x-axis tics
yticks=ymin:5:ymax;                    % y-axis ticks
set(gca,’XTick’,xticks);
set(gca,’YTick’,yticks);
grid