% Script C7
% Checks out GenEig
clc
randn('seed',0)
n = 21;

A = randn(n,n);
B = randn(n,n);
d0 = eig((A*inv(B) + B*inv(A))/2);
[z,idx] = sort(real(d0));
d0 = d0(idx);
d = GenEig(A,B);
[z,idx] = sort(real(d));
d = d(idx);
format short
TwoVecs = [d d0]