Code covered by the BSD License  

Highlights from
AXY2VE

Be the first to rate this file! 1 Download (last 30 days) File Size: 1.63 KB File ID: #20023

AXY2VE

by Joseph Kirk

 

22 May 2008 (Updated 27 May 2008)

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

| Watch this File

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

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.
Comments and Ratings (1)
28 May 2008 John D'Errico

This does not download properly for me. When I've seen this happen, it is usually browser related for some reason. It only happens when simple m-files are uploaded.

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:57
digraph Joseph Kirk 22 Oct 2008 10:02:57
adjacency matrix Joseph Kirk 22 Oct 2008 10:02:57
xy Joseph Kirk 22 Oct 2008 10:02:57
vertex Joseph Kirk 22 Oct 2008 10:02:57
edge Joseph Kirk 22 Oct 2008 10:02:57

Contact us at files@mathworks.com