MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab,找到不参与边的节点? (https://www.labfans.com/bbs/showthread.php?t=22994)

poster 2019-12-10 16:49

Matlab,找到不参与边的节点?
 
在下面的Matlab代码中,节点为N=10 ,您将获得随机选择的节点,概率为P= .25标记为红色节点。

nodeN = []; nodeM = []; N=input('No. of Nodes:'); P=input('probability of cluster head : '); R=input('range of cluster head: ') data = rand(N,2) % Randomly generated n no. of nodes x = data(:,1); y = data(:,2); plot(x,y,'b*') hold on index = (rand(N,1)


所有时间均为北京时间。现在的时间是 01:07

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.