Following errors are coming. I have attached those errors as screenshot.
can anyone help me out with it.

1 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 16 日
Please provide in cody format, not screensheet.

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2019 年 12 月 16 日

0 投票

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 についてさらに検索

タグ

質問済み:

2019 年 12 月 16 日

回答済み:

2019 年 12 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by