<< NL_G_AddEdges NL_G: Graph NL_G_AdjacencyMatrix >>

NARVAL >> NL_G: Graph > NL_G_AddNodes

NL_G_AddNodes

Add a list of new nodes to a graph.

Calling Sequence

[Go] = NL_G_AddEdges(G,X,Y,Na)

Arguments

G :

Graph.

X :

X-coordinates of new nodes.

Y :

Y-coordinates of new nodes.

Na :

names of new nodes.

:

Output graph.

Description

NL_G_AddNodes adds the set of N new nodes of name Na defined by their x-coordinates and y-coordinates into the graph G. The output graph is stored in .

Examples

[g]=NL_G_MakeGraph('g1',4,[1 2 3 4],[2 3 4 1],[100 100 900 900],[100 900 900 100]);//generation of a graph
g.node_name=['n1' 'n2' 'n3' 'n4'];
g.edge_name=['e1' 'e2' 'e3' 'e4'];
nx=[300 600];//new nodes x-coordinates
ny=[600 300];//new nodes y-coordinates
nn=['n5' 'n6'];//name vector of new edges
[go]=NL_G_AddNodes(g,nx,ny,nn);//application of NL_G_AddNodes
go.name='g2';
i1=1;
f=NL_G_ShowGraph(g,i1);
i2=2;
f2=NL_G_ShowGraph(go,i2);

Dependency

NL_G_MakeGraph, NL_G_GraphEdgesLength

Report an issue
<< NL_G_AddEdges NL_G: Graph NL_G_AdjacencyMatrix >>