Clear Filters
Clear Filters

avoid repetition of value in genetic algorithm output....

3 views (last 30 days)
I did a genetic algorithm code as below...
lb = [1 1 1 1 1 1 1 1 1 1];
ub = [10 10 10 10 10 10 10 10 10 10];
intCon = 1:10;
[x,fval] = ga(FitnessFunction,10,[],[],[],[],lb,ub,[],intCon,options)
I get output "x" as a vector of size [1 10] for example as follows...
(my output eg:) x = 4 3 3 2 9 4 4 6 1 1
but i need to get a output as example,
(what i want eg:) x = 2 10 3 8 1 6 4 9 5 7
that is i should not get repeated values and my outputx should be if size [1 10] .... but in my output i get repeated values... please can someone tell me how to remove repetition... should i set any options for that,.... please do reply....

Accepted Answer

Walter Roberson
Walter Roberson on 25 Apr 2016

More Answers (0)

Community Treasure Hunt

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

Start Hunting!