GA Optimization running. Error running optimization. Not enough input arguments. what to do
1 次查看(过去 30 天)
显示 更早的评论
my function is simple 3 variables as shown bellow
function x = material(s,f,d)
x = (-0.552042 - (6.39734e-005*(s)) + (14.3154 (f)) + (0.261111 (d))); end and while running GA i get "not enough input arguments" This is the first time iam using GA tool so any one please help me with this problem. And specify any other steps that has to done in GA optimization tool.
0 个评论
回答(1 个)
A Jenkins
2015-1-8
function [s_star,f_star,d_star]=find_optim()
nvars=3; %s, f, d
options=gaoptimset(@ga); % defaults, but you will need to change things
options=gaoptimset(options,'PlotFcns',{@gaplotbestf,@gaplotbestindiv});
x_star=ga(@material,nvars,options);
s_star=x_star(1); f_star=x_star(2); d_star=x_star(3);
end
function x = material(x)
s=x(1); f=x(2); d=x(3);
x = (-0.552042 - (6.39734e-005*s) + (14.3154*f) + (0.261111*d));
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!