• 大小: 8KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: Matlab
  • 标签: matlab  

资源简介

matlab复杂网络及其零模型拓扑性质的计算,包括度分布,余度分布,平均路径长度,聚类系数,余平均度等等

资源截图

代码片段和文件信息


%UNtitleD Summary of this function goes here
%   Detailed explanation goes here
function ND_netplot(A)
        [n n]=size(A);
        w=floor(sqrt(n));       
        h=floor(n/w);        
        x=[];
        y=[];
        for i=1:h           %使产生的随机点有其范围,使显示分布的更广
            for j=1:w
                x=[x 10*rand(1)+j*10];
                y=[y 10*rand(1)+(i-1)*10];
            end
        end
        ed=n-h*w;
        for i=1:ed
           x=[x 10*rand(1)+i*10]; 
           y=[y 10*rand(1)+h*10];
        end
        plot(xy‘r*‘);    
        
        title(‘网络拓扑图‘); 
        for i=1:n
            for j=i:n
                if A(ij)~=0
                    c=num2str(A(ij));                      %将A中的权值转化为字符型              
%                     text((x(i)+x(j))/2(y(i)+y(j))/2c‘Fontsize‘10);  %显示边的权值
                    line([x(i) x(j)][y(i) y(j)]);      %连线
                end
                text(x(i)y(i)num2str(i)‘Fontsize‘14‘color‘‘r‘);   %显示点的序号            
                hold on;
            end
        end  

end


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1861  2016-12-23 19:14  matlab_fuza\data9.csv

     文件       1139  2016-12-26 14:55  matlab_fuza\ND_netplot.m

     文件       5868  2016-12-26 14:33  matlab_fuza\yuanshi.m

     文件          0  2016-12-26 11:26  matlab_fuza\zero.m

     文件       6706  2016-12-26 14:32  matlab_fuza\zero0.m

     文件       7115  2016-12-26 14:33  matlab_fuza\zero2.m

     目录          0  2016-12-27 17:19  matlab_fuza

----------- ---------  ---------- -----  ----

                22689                    7


评论

共有 条评论