Am trying to plot the selected individual in This Code
and the code for selecting the top individuals in the population is this:
top_x = pop(b(1:options.topSize),:)
The code for Generating the initial population is This:
M = 50; % population size
n = 2;
pop = -50 + 100.*rand(M,n);
. This is done in a for loop. See Here
for the entire code
but anytime i look at the plot of the initial population and the selected population, i.e plot for pop and top_x, they look different. The position of the selected ones are different from their position in the initial population. Why is this happening. The concern code is in ID: 39196865.
The plot are outside the loop.
The code for the two plots are here:
scatter(pop(:,1), pop(:,2), 'x'); and