% dimension
N = 4;
% random matrices
A = rand(N,N);
B = rand(N,N);
%force symmetry
A = A+A';
B = B+B';
% number of points in plot
P = 400;
% with the standard output this gives almost 1pixel precision
R = zeros(N,P);
P = P-1;
for n=0:P;
R(:,n+1) = eig((1-n/P)*A+n/P*B);
end
t = [0:1/P:1];
% plot graphs.
figure(1)
plot(t,R,'-','linewidth',3)
|
% ii = number of the low graph, [a,b] =interval
function zoomm( A,B, N, ii, a, b )
% number of points in plot
P = 400;
% with the standard output this gives almost 1pixel precision
R = zeros(N,P);
P = P-1;
for n=0:P;
t = a + n*(b-a)/P;
R(:,n+1) = eig((1-t)*A+t*B);
end
t = linspace(a,b,P+1);
figure(2)
plot(t,R(ii,:),'-', t,R(ii+1,:),'-','linewidth',3)
|