フィルターのクリア

Genetic algorithm- error when providing constraints in a loop

1 回表示 (過去 30 日間)
Umber Saleem
Umber Saleem 2019 年 4 月 2 日
コメント済み: Walter Roberson 2019 年 4 月 2 日
Hi. I am using ga for a problem with multiple constraints. I provide constraints in a for loop using the comand "vercat" and I get the following error on execution
Not enough input arguments.
Error in simple_constraint (line 13)
c=vertcat(c,(sum(x(cin)))-1);
Does GA allow this? or I will have to hardcode each constraint? Please guide.
  9 件のコメント
Umber Saleem
Umber Saleem 2019 年 4 月 2 日
excluding the use of global variables, I have tried the follwoing constraint which is hard coded as
c=[x(3)+x(4)+x(5)+x(6)+x(7)+x(8)+x(9)+x(10)+x(11)+x(12)+x(13)-2];
but the error is same.
Walter Roberson
Walter Roberson 2019 年 4 月 2 日
We can make guesses, but it is difficult to reproduce that behaviour without the actual code.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by