Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Locate edge in graph

`[sOut,tOut] = findedge(G)`

`[sOut,tOut] = findedge(G,idx)`

`idxOut = findedge(G,s,t)`

`[idxOut,m] = findedge(G,s,t)`

returns the numeric edge indices, `idxOut`

= findedge(`G`

,`s,t`

)`idxOut`

, for the edges specified
by the source and target node pairs `s`

and `t`

.
The edge indices correspond to the rows `G.Edges.Edge(idxOut,:)`

in
the `G.Edges`

table of the graph. If there are multiple edges
between `s`

and `t`

, then all their indices are
returned. An edge index of `0`

indicates an edge that is not in the
graph.

Was this topic helpful?