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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.