⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphsavetofile.m

📁 复杂网络的一些节点面对攻击的代码
💻 M
字号:
function Success = GraphSaveToFile(Graph,FileName)
% Saves the Graph to Mat-file
%
% Receives:
%   Graph       -   Graph Struct                -   the graph loaded with GraphLoad
%   FileName    -   string                      -   the name if the file to store the data to. If the file exists, it is overwritten
%
% Returns:
%   Success     -   boolean                     -   true (1) if succeeded, false (0) - if not
%
% Created:
%   Lev Muchnik    16/08/2005, Tel.: 972-054-4326496, 89 Beacon, Somerville, MA, USA

error(nargchk(2,2,nargin));
error(nargoutchk(0,1,nargout));

ObjectIsType(Graph,'Graph','The operation can only be performed on Graphs');

try
    if exist(FileName,'file')==2
        delete(FileName);
    end
    save(FileName,'Graph','-mat');
    Success = 1;
catch
    Success=0;
end

⌨️ 快捷键说明

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