Skip to content

Instantly share code, notes, and snippets.

@danbri
Created July 26, 2011 14:45
Show Gist options
  • Save danbri/1106918 to your computer and use it in GitHub Desktop.
Save danbri/1106918 to your computer and use it in GitHub Desktop.
function [LAP] = laplacian(A1);
A2 = A1 * -1; # adj. matrix where -1 shows a link
N = length(A2);
Z = zeros(N);
S = abs(sum(A2));
for K = 1:N;
Z(K,K)=S(K);
end
LAP = A2+Z;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment