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

2 visualizaciones (últimos 30 días)
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

Respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by