%% Add Nodes to Graph
% Add two nodes to a graph that does not have node names.

G = graph([1 2 3],[2 3 4])

%

G = addnode(G,2)

%
% Add node names to the graph, and then add five additional new nodes. The auto-generated names for the new nodes indicate their placement in G.Nodes.Name.

G.Nodes.Name = {'A' 'B' 'C' 'D' 'E' 'F'}'

%

G = addnode(G,5);
G.Nodes

% Copyright 2015 The MathWorks, Inc.