num_edges.m

来自「The MatlabBGL library fills a hole in Ma」· M 代码 · 共 15 行

M
15
字号
function n=num_edges(A)
% NUM_EDGES The number of edges in a graph.
%
% n = num_edges(A) returns the number of edges in graph A.  
%
% For symmetric/undirected graphs, the number of edges returned is twice 
% the number of undirected edges.
%
% Example:
%    load graphs/dfs_example.mat
%    n = num_edges(A)
%
% See also NUM_VERTICES

n = nnz(A);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?