i need to calculate fitness value and save that in separate .mat file

조회 수: 2 (최근 30일)
SARAH LONER
SARAH LONER 2020년 1월 22일
n=number of node (i have 100 nodes)
mch = cluster head per each round of node (here i gave number of round =30 nd i get 14 cluster head nodes) % didnt take repeted cluster heads
residual energy = sum of energy for 30 rounds
p1 and p2= randam numbers between 0 abd 1
i store mch in mat nd residualenergy into another mat file
i need to calculate each time fitness value for 100 nodes based on my cluster heads and residual energy
for i=1:n
Fit = p1 .*(n.* (mch(i,:))) + p2 .*sum (resdialenergy(i,:))
end
error at
Index in position 1 exceeds array bounds.
Error in ch_rnd (line 305)
Fit = p1 .*(n.* (mch(i,:))) + p2 .*sum (resdialenergy(i,:))
i need to sort this kindly help me its urgent

답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by