How to visualize a directed graph on Matlab?
The digraph() Matlab function creates a directed graphs object (directional edges connecting the nodes). The following example plot a directed graph from the adjacency matrix :
% Adjacency matrix
A = [ 0 1 0 1 ;
1 0 1 1 ;
0 1 1 1 ;
0 0 0 1 ];
% Create directed graph object
G = digraph(A);
% Plot directed graph
p=plot(G, 'MarkerSize', 10);
The above code displays the following figure:
The digraph() Matlab function creates a directed graphs object (directional edges connecting the nodes). The following example plot a directed graph from the adjacency matrix :
% Adjacency matrix
A = [ 0 1 0 1 ;
1 0 1 1 ;
0 1 1 1 ;
0 0 0 1 ];
% Create directed graph object
G = digraph(A);
% Plot directed graph
p=plot(G, 'MarkerSize', 10);
The above code displays the following figure:
The digraph() Matlab function creates a directed graphs object (directional edges connecting the nodes). The following example plot a directed graph from the adjacency matrix :
% Adjacency matrix
A = [ 0 1 0 1 ;
1 0 1 1 ;
0 1 1 1 ;
0 0 0 1 ];
% Create directed graph object
G = digraph(A);
% Plot directed graph
p=plot(G, 'MarkerSize', 10);
The above code displays the following figure:
The digraph() Matlab function creates a directed graphs object (directional edges connecting the nodes). The following example plot a directed graph from the adjcency matrix :
% Adjacency matrix
A = [ 0 1 0 1 ;
1 0 1 1 ;
0 1 1 1 ;
0 0 0 1 ];
% Create directed graph object
G = digraph(A);
% Plot directed graph
p=plot(G, 'MarkerSize', 10);
The above code displays the following figure:
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 12815 | en | https://en.ans.wiki/6732/how-to-visualize-a-directed-graph-on-matlab | 6 |