graphmakeundirected.m
来自「复杂网络的一些节点面对攻击的代码」· M 代码 · 共 22 行
M
22 行
function Graph = GraphMakeUndirected(Graph)
% Reverses and duplicates each directional link in graph. If there exists a link A->B, then B->A is added.
%
% Receives:
% Graph - Graph Struct - the graph loaded with GraphLoad
%
% Returns:
% Graph - Graph Struct - the graph loaded with GraphLoad without duplicate links
%
% See Also:
% GraphLoad, GraphRemoveDuplicateLinks, GraphReverseLinks
%
% Created:
% Lev Muchnik 22/02/2005, Tel.: 972-054-4326496
error(nargchk(1,1,nargin));
error(nargoutchk(0,1,nargout));
ReversedLinks = [Graph.Data(:,2) Graph.Data(:,1) Graph.Data(:,3)];
Graph.Data = [ReversedLinks; Graph.Data];
Graph = GraphRemoveDuplicateLinks(Graph);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?