why these errors are occuring?
이전 댓글 표시
Following errors are coming. I have attached those errors as screenshot.
can anyone help me out with it.


댓글 수: 1
KALYAN ACHARJYA
2019년 12월 16일
Please provide in cody format, not screensheet.
답변 (1개)
Steven Lord
2019년 12월 16일
What is Problem.obj? Is it a function handle or is it an array?
If it's an array, then this section of code inside GeneticAlgorithm is an attempt to index into it rather than an attempt to call a function with inputs. If any of the elements of population.Chromosomes(i).Gene are not valid indices for that array, you will receive an error.
population.Chromosomes(i).fitness = obj( population.Chromosomes(i).Gene(:) );
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!