Code covered by the BSD License  

Highlights from
VE2AXY

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.85 KB File ID: #20024

VE2AXY

by Joseph Kirk

 

22 May 2008 (Updated 27 May 2008)

converts graph of vertices and edges to adjacency matrix and xy points

| Watch this File

File Information
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

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
graph Joseph Kirk 22 Oct 2008 10:02:58
digraph Joseph Kirk 22 Oct 2008 10:02:58
adjacency matrix Joseph Kirk 22 Oct 2008 10:02:58
xy Joseph Kirk 22 Oct 2008 10:02:58
vertex Joseph Kirk 22 Oct 2008 10:02:58
edge Joseph Kirk 22 Oct 2008 10:02:58

Contact us at files@mathworks.com