GREDGELENGTHS Compute length of edges in a geometric graph.
LENGTHS = grEdgeLengths(NODES, EDGES)
Example
% create a basic graph and display it
nodes = [10 10;20 10;10 20;20 20;27 15];
edges = [1 2;1 3;2 4;2 5;3 4;4 5];
figure; drawGraph(nodes, edges);
hold on; drawNodeLabels(nodes, 1:5)
axis equal; axis([0 40 0 30]);
% compute list of nodes adjacent to node with index 2
grEdgeLengths(nodes, edges)'
ans =
10.0000 10.0000 10.0000 8.6023 10.0000 8.6023
See also
Package: matgeom