function AnalyseEigs( A )
%PlotEigs plots the eigenvalues of a matrix
n=size(A,1);
d = eig(full(A));
NRlEval = 0;
NPosEval = 0;
for i=1:n
    if isreal(d(i))
        NRlEval = NRlEval + 1;
        if d(i)>0
            NPosEval = NPosEval + 1;
        end
    else
        if real(d(i))>0
            NPosEval = NPosEval + 1;
        end
    end
end
ImPart = norm(imag(d));
MxEval = max(abs(d));
MnEval = min(abs(d));
if ImPart>1e-4
    fprintf('\nEigenvalues have imaginary part of norm %g\n', ImPart)
    plot(log10(d),'k.')
    xlabel('log10(Re(lambda))')
    ylabel('log10(Im(lambda))')
else
    plot(log10(abs(d)),'k.')
%    legend('log10(eig(A))','Location','NorthWest')
    xlabel('Index')
    ylabel('log10(lambda)')
end
fprintf('\nMatrix has %d complex and %d non-positive eigenvalues\n', n-NRlEval, n-NPosEval)
fprintf('\n|lambda| lies in [%g, %g]; Condition = %g\n', MnEval, MxEval, MxEval/MnEval)
end

