problem in GA code

1 次查看(过去 30 天)
brahmi ibtissem
brahmi ibtissem 2019-8-4
Hello everyone,
how can i solve this problem in my code?
Index exceeds matrix dimensions.
Error in selection (line 24)
temp_population.Chromosomes(i).Gene = population.Chromosomes(sorted_idx(i)).Gene;
Error in GeneticAlgorithm (line 29)
[ parent1, parent2] = selection(population);
Error in Main (line 44)
[BestChrom] = GeneticAlgorithm (M , N, MaxGen , Pc, Pm , Er , Problem.obj , visualization)
  1 个评论
Walter Roberson
Walter Roberson 2019-8-4
GeneticAlgorithm is not a Mathworks supplied routine so we can only make wild guesses about it unless you can supply a link to it (and tell us about the sizes and datatype of the inputs you are passing it)

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by