%% Outgoing Edges of Selected Node
% Create an undirected multigraph with three nodes and four edges. Find the outgoing edges of node 2.

G = graph([1 1 1 2],[2 2 3 3]);
G.Edges

%

eid = outedges(G,2)

%
% The vector eid contains indices to rows in the G.Edges table. Use the vector to index into G.Edges.

G.Edges(eid,:)

% For undirected graphs, the edges (1,2) and (2,1) are the same.
%
% Copyright 2012 The MathWorks, Inc.