| Description |
AXY2VE Convert Graph of Adjacency Matrix and XY Points to Vertices and Edges
Inputs:
A is a NxN adjacency matrix, where A(I,J) is nonzero
if and only if an edge connects point I to point J
xy is a Nx2 (or Nx3) matrix of x,y,(z) coordinates (equivalent to V)
Outputs:
V is a Nx2 (or Nx3) matrix of x,y,(z) coordinates
E is a Px2 matrix containing a list of edge connections
Example:
n = 10;
xy = 10*rand(n,2)
A = round(rand(n))
spy(A);
[V,E] = axy2ve(A,xy)
Example:
n = 2e4;
xy = 10*rand(n,2);
A = sparse(n,n);
IJ = ceil(n*n*rand(n,1));
A(IJ) = 1;
spy(A);
[V,E] = axy2ve(A,xy);
See also: VE2AXY |