%% Add Named Nodes to Graph
% Create a directed graph with named nodes, and then add two named nodes to the graph.

G = digraph({'A' 'B' 'C'},{'D' 'C' 'D'})

%

G = addnode(G,{'E' 'F'})

%
% If the graph does not already have node names, then adding named nodes to the graph automatically generates names for the other nodes.
% Create a directed graph without node names, and then add two named nodes to the graph.

H = digraph([1 2 3],[4 3 4])

%

H = addnode(H,{'E','F'});
H.Nodes

% Copyright 2015 The MathWorks, Inc.