%ROULDIST Empirical distribution of number of real eigenvalues. k = 1000; wheel = zeros(k,1); for i = 1:k A = randn(8); % Count number of eigenvalues with imag. part < tolerance. wheel(i) = sum(abs(imag(eig(A)))<.0001); end hist(wheel,[0 2 4 6 8]);