Skip to content
Browse files

Put in function for random geometric graph

  • Loading branch information...
1 parent 977dc74 commit 05a3f05c459e7978a7a0dcbdc4559d9bae8d0431 @dgleich committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 randgeom.m
View
9 randgeom.m
@@ -0,0 +1,9 @@
+function [S,xy] = randgeom(nverts,randfunc)
+% RANDGEOM Produce a random geometric graph in the plane
+%
+%
+if ~exist('randfunc','var') || isempty(randfunc), randfunc='rand'; end
+nxy = nverts;
+xy = feval(randfunc, nxy, 2);
+tri = delaunay(xy(:,1),xy(:,2));
+S = sparse(tri(:,[1 1 2 2 3 3]),tri(:,[2 3 1 3 1 2]),1,nxy, nxy);

0 comments on commit 05a3f05

Please sign in to comment.
Something went wrong with that request. Please try again.