I want to use GA algorithm, but it gives me this error "Not enough input arguments. "
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I want to use GA algorithm gor my application but it gives me this error any body knows the problem?
code:
LB= zeros(1,9);
UB= zeros(1,9);
for i = 1:9
LB(1,i) = 1;
end
for i = 1:9
UB(1,i) = 3;
end
LB(1,10:17) = [0 -5.1 0.01 0.01 0.01 0.1 0.1 0.1];
UB(1,10:17) = [100 4 1 1 1 200 200 2000];
options = optimoptions(@ga,'PopulationSize', 80, ...
'MaxGenerations', 20, ...
'Display','iter');
x = ga(flc_cost_fcn,17,[],[],[],[],LB,UB,[],options);
[cost, out] = flc_cost_fcn (x);
error:
Not enough input arguments.
Error in flc_cost_fcn (line 10)
a = floor(p(1:9));
Error in untitled5 (line 28)
x = ga(flc_cost_fcn,17,[],[],[],[],LB,UB,[],options);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!