Skip to content

Commit

Permalink
Create eigenlap.m
Browse files Browse the repository at this point in the history
  • Loading branch information
nolte committed Feb 1, 2021
1 parent 2b4f2b3 commit 6c340dc
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions eigenlap.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
% function [synch,l2,lmax,spec] = eigenlap(node)
% Calculates the eigenvalues 2 and N
% synch = ratio l2/lmax gives measure of synchronizabity
% spec is the full spectrum


function [synch,l2,lmax,spec] = eigenlap(node)

[A,degree,Lap] = adjacency(node);

[dum,N] = size(Lap);
l = eig(Lap);
spec = l;

flag = 0; ind = 1;
while flag == 0
ind = ind + 1;
l2tmp = min(l(ind:N));
if l2tmp > 1/sqrt(N)
l2 = l2tmp;
flag = 1;
end
end


lmax = l(N);
synch = lmax/l2;

0 comments on commit 6c340dc

Please sign in to comment.