fun_degree.m

来自「无标度网络的生成模型」· M 代码 · 共 18 行

M
18
字号
%% 计算链接矩阵中节点的度

%%输入:链接矩阵,输出:节点的度,列向量

function [Row_Degree , Mat_DegreeRelation] = Fun_Degree ( Net)

%% 将链接矩阵换算为两个节点无连边,则为0的格式
Mat_DegreeRelation = Net;
Int_Num = size(Net ,1);
for i=1:Int_Num
    for j= 1: Int_Num
        if Net(i, j) == Inf
            Mat_DegreeRelation(i,j) = 0;
        end 
    end 
end 

Row_Degree =  sum( Mat_DegreeRelation, 1);

⌨️ 快捷键说明

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