how to update number of nodes variable after every iteration in wsn

조회 수: 3 (최근 30일)
kiranpreet kaur
kiranpreet kaur 2016년 11월 1일
답변: Walter Roberson 2016년 11월 20일
i have to update number of nodes after the completion of 100 rounds,..........plz help me how to do so
for r=0:1:maximum_lifetime
r
if(mod(r, round(1/p) )==0) %remainder
for i=1:1:n
leach(i).G=0; % it will assign to the nodes that have not been cluster head .
end
end
hold off;
dead=0;
figure(1);
here i want to run for loop again for new nodes

답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 20일
Your code has no "number of nodes" variable, and you give no information that might allow us to figure out how many nodes exist.

카테고리

Help CenterFile Exchange에서 WSNs에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by