H = flipedge(G)
returns a directed graph that has the same edges as G, but with
reversed directions. H contains the same node and edge properties
as G.
Input graph, specified as a digraph object. Use digraph to create a directed graph object.
Example: G = digraph([1 2],[2 3])
Node pairs, specified as separate arguments of node indices or node names.
Similarly located elements in s and t
specify the source and target nodes for edges in the graph.
This table shows the different ways to refer to one or more nodes either by their numeric node indices or by their node names.
Form
Single Node
Multiple Nodes
Node index
Scalar
Example:1
Vector
Example:[1 2 3]
Node name
Character vector
Example:'A'
Cell array of character vectors
Example:{'A' 'B' 'C'}
String scalar
Example:"A"
String array
Example:["A" "B" "C"]
Example: H = flipedge(G,[1 4],[2 3]) reverses the
direction of the edges (1,2) and (4,3).
Example: H = flipedge(G,{'a' 'd'},{'b' 'c'}) reverses
the direction of the edges (a,b) and (d,c).
Edge indices, specified as a scalar or vector of positive integers. Each
edge index corresponds to a row in the G.Edges table of
the graph G.Edges(idx,:).
Example: H = flipedge(G,3) flips the direction of edge
G.Edges(3,:).
Output graph, returned as a digraph object. Compared to
G, H has the same nodes but some
or all of the edges are in reversed direction. H also has
the same node and edge properties as G.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.