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 Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by