function gersh(G)

% Plots the Gershgorin bands of system G
%
% GERSH(SYS) draws the Gershgorin bands of the LTI model SYS in the
% complex plane.

decadi=3;
npunti=100;

clf; hold on; grid on

%-- plot the gershgorin bands
w=logspace(-decadi,decadi,npunti);
fr=freqresp(G,w);
for i=1:size(fr,3), gershgorin(fr(:,:,i)); end
%------

%-- plot the nyquist array
w1=logspace(-decadi,decadi,1000);
fr1=freqresp(G,w1);
for i=1:size(fr1,1), Gdiag(i,:)=fr1(i,i,:); end
h=plot(Gdiag.');
set(h,'LineWidth',2);
%------

