image thumbnail
from Gerschgorin's disk Thm (a test) by Summit Suen
plot eigenvalue on complex plane show that all these points located in such circles.

testGerschgorin(A)
function testGerschgorin(A)
% ------------------------------------------------------
% 4-1
% test for Gerschgorin's disk Thm with A a C(m*m) matrix
% ex : >>testGerschgorin(A) ;
%    % plot eigenvalues in redx located in these circles
% note : you could use this without input A as a demo
% ------------------------------------------------------
%                                 Summit.Suen(at)NTUMath 
%                                   b93201006@ntu.edu.tw
%                                    14.May.2007
%                                    17.May.2007 revised
if (nargin==0)
    A = randn(10) + j*rand(10) ;
end
clf
n = length(A) ;
d = max(max(abs(A))) ; r = zeros(1,n) ;
r = sum(abs(A(:,:)))-abs(diag(A)') ; % vector version to set up r
%for i = 1:n
%    r(i) = sum(abs(A(:,i)))-A(i,i) ;
%end % for-loop version to set up r
d = d+max(r) ;
for i = 1:n
    THETA = linspace(0,2*pi,1e5) ;
    RHO = ones(1,1e5)*r(i) ;
    [X,Y] = pol2cart(THETA,RHO) ;
    X = X+real(A(i,i)) ;
    Y = Y+imag(A(i,i)) ;
    plot(X,Y) ;
    axis square ; hold on % point ploting is faster!
end
%D = [-d d -d d] ;
%syms x y ;
%for i = 1:n
%    g = (x-real(A(i,i)))^2+(y-imag(A(i,i)))^2-r(i)^2 ;
%    ezplot(g,D) 
%    hold on
%end % built-in function ploting
egv = eig(A) ;
plot(real(egv),imag(egv),'rx')
axis square ; axis equal ;
title('test for Gerschgorin disk Thm')

Contact us at files@mathworks.com