%% Out-degree of Subset of Graph Nodes
% Create and plot a directed graph with named nodes. Then compute the number of edges that have the 'a', 'b', and 'f' nodes as their source.

s = {'a' 'c' 'b' 'b' 'd' 'e' 'a' 'b'};
t = {'b' 'b' 'd' 'e' 'f' 'f' 'f' 'f'};
G = digraph(s,t);
plot(G)

%

nodeID = {'a' 'b' 'f'}';
outdeg = outdegree(G,nodeID)

% outdeg(j) indicates the out-degree of node nodeID(j).
% Copyright 2015 The MathWorks, Inc.