%% Degree of All Graph Nodes
% Create and plot a graph, and then use degree to find the degree of each node in the graph.

s = [1 1 1 4 4 6 6 6];
t = [2 3 4 5 6 7 8 9];
G = graph(s,t);
plot(G)

%

deg = degree(G)

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