%% Add Weighted Edges to Graph
% Create a directed graph with weighted edges.

G = digraph({'A' 'B' 'C'}, {'D' 'C' 'D'}, [10 20 45])

%
% Add three new weighted edges to the graph. addedge also automatically adds any required new nodes to the graph.

G = addedge(G, {'A' 'D' 'E'}, {'E' 'B' 'D'}, [5 30 5])

% Copyright 2015 The MathWorks, Inc.