Skip to content

Instantly share code, notes, and snippets.

@gajomi
Created May 8, 2012 17:16
Show Gist options
  • Save gajomi/2637517 to your computer and use it in GitHub Desktop.
Save gajomi/2637517 to your computer and use it in GitHub Desktop.
Method for counting disjoint pairwise motifs in N^2
N = 5;
C = triu(ones(N,N));
A = C(1:N,N:-1:1);
A(N,N) = 1;
D = A*ones(N,N)*A - A^3;
H = (A==0).*D/2;
U = sum(H(:))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment