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개)

카테고리

도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2019년 8월 4일

댓글:

2019년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by