| Description |
VE2AXY Convert Graph of Vertices and Edges to Adjacency Matrix and XY Points
Inputs:
V is a Nx2 (or Nx3) matrix of x,y,(z) coordinates
E is a Px2 matrix containing a list of edge connections
Outputs:
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)
Example:
n = 10;
V = 10*rand(n,2)
E = ceil(n*rand(3*n,2))
[A,xy] = ve2axy(V,E)
spy(A);
Example:
n = 2e4;
V = 10*rand(n,2);
E = ceil(n*rand(n,2));
[A,xy] = ve2axy(V,E);
spy(A);
See also: AXY2VE |