GA Optimization running. Error running optimization. Not enough input arguments. what to do

조회 수: 3 (최근 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.

답변 (1개)

A Jenkins
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 CenterFile 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!

Translated by