How to order 'n' no of populations in ascending order based on their fitness for a minimization objective in matlab

1 view (last 30 days)
How to order 'n' no of populations in ascending order based on their fitness for a minimization objective in matlab?
  1 Comment
dhiman banerjee
dhiman banerjee on 20 Sep 2019
Thank you for the reply. But this code gives fitness value of te each population in acending order. My problem is - that to reorder each population (i.e rows of the population matrix) as per the fitness value of each population in ascending order (Minimization objective)
Kindly help me in this point.

Sign in to comment.

Accepted Answer

thoughtGarden
thoughtGarden on 19 Sep 2019
Edited: thoughtGarden on 20 Sep 2019
I'm assuming you already have the fitness of each population according to the minimization objective. If this is the case, you will simply obtain the index order from the "sort" function while using the "direction" parameter.
sortedIndex = sort(fitnessVector, [],'ascend');
If you found this answer to be correct, please accept it. Otherwise, please add aditional comments so that it may be improved.

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!