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

2 次查看(过去 30 天)
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