i need to calculate fitness value and save that in separate .mat file
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!