Number of edges in graph
N = numedges(G)
example
N = numedges(G) returns the number of edges in graph G.
N
G
collapse all
Use the bucky adjacency matrix to create a directed graph, and then determine how many edges the graph contains.
bucky
G = digraph(bucky)
G = digraph with properties: Edges: [180x2 table] Nodes: [60x0 table]
N = 180
graph
digraph
Input graph, specified as either a graph or digraph object. Use graph to create an undirected graph or digraph to create a directed graph.
Example: G = graph(1,2)
G = graph(1,2)
Example: G = digraph([1 2],[2 3])
G = digraph([1 2],[2 3])
Number of edges, returned as a scalar.
addedge | digraph | graph | numnodes | rmedge
addedge
numnodes
rmedge
You have a modified version of this example. Do you want to open this example with your edits?