<< NL_G_MeanLocalClustering NL_G: Graph NL_G_NodeDataFields >>

NARVAL >> NL_G: Graph > NL_G_NodeClose2XY

NL_G_NodeClose2XY

Find the closest node from a geographic location.

Calling Sequence

[I] = NL_G_NodeClose2XY(G,X,Y)

Arguments

G :

Graph.

X :

X-coordinate.

Y :

Y-coordinate.

I :

Node index.

Description

NL_G_NodeClose2XY finds the closest node I from the geographic location (X,Y).

Examples

n=100;//network size
l=1000;//network squared area side
d=100;//Locality radius
[g]=NL_T_LocalityConnex(n,l,d);//generation of a random topology
ind=1;//window index
f=NL_G_ShowGraphN(g,ind);//graph visualization
xc=l/2;//area center
yc=l/2;
[nc]=NL_G_NodeClose2XY(g,xc,yc)//application of NARVAL_G_NodeClose2XY
c=5;//visualization parameters: color, border and diameter 
b=10;
d=50;
i2=2;//window index
nodes=[1 2 6 10];//list of nodes
[gm,f2]=NL_G_HighlightNodes(g,nc,c,b,d,i2);

Report an issue
<< NL_G_MeanLocalClustering NL_G: Graph NL_G_NodeDataFields >>