%% Degree of Subset of Graph Nodes
% Create and plot a graph, and then find the degree of the first, third, and fifth nodes.

s = {'a' 'a' 'a' 'd' 'd' 'f' 'f' 'f'};
t = {'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i'};
G = graph(s,t);
plot(G)

%

nodeIDs = {'a' 'c' 'e'}';
deg = degree(G,nodeIDs)

% deg(j) indicates the degree of node nodeIDs(j).
% Copyright 2015 The MathWorks, Inc.