Created
May 28, 2014 16:27
-
-
Save gajomi/1f08e73581cc09752382 to your computer and use it in GitHub Desktop.
Structured matrix eigenvalue clusters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%params | |
N = 512; | |
k = 128; | |
p = .5; | |
%form block clustered matrix | |
A = rand(N,N)>p;%or randn(N,N) also | |
B = diag([50*ones(1,k) 1*ones(1,N-k)]); | |
C = A+B; | |
%compute spectrum | |
E = eig(C); | |
%plot stuff | |
figure(1) | |
subplot(211) | |
imagesc(C) | |
subplot(212) | |
plot(E,'o') | |
axis(equal) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment