i'm getting followig errors when options are used in ga solver

2 ビュー (過去 30 日間)
Arunachalam  D
Arunachalam D 2015 年 4 月 5 日
編集済み: Geoff Hayes 2015 年 4 月 5 日
main function
clear all
clc
nvars=3;
lb=[6 2 2];
ub=[100 4 4];
options = gaoptimset('PlotFcns',{@gaplotbestf,@gaplotmaxconstr},'Display','iter');
[x, fval,exitflag,output,population]=ga(@my_fun,nvars,[],[],[],[],lb,ub,options)
error when using options
Error using functionHandleOrCell (line 13)
The constraint function must be a function handle.
Error in validate (line 156)
[nonlcon,NonconFcnArgs] = functionHandleOrCell('NonconFcn',nonlcon);
Error in gacommon (line 72)
[options,nvars,FitnessFcn,NonconFcn] =
validate(options,type,nvars,fun,nonlcon,user_options);
Error in ga (line 319)
[x,fval,exitFlag,output,population,scores,FitnessFcn,nvars,Aineq,bineq,Aeq,beq,lb,ub, ...
Error in start (line 7)
[x, fval,exitflag,output,population]=ga(@my_fun,nvars,[],[],[],[],lb,ub,options)

採用された回答

Jan
Jan 2015 年 4 月 5 日
Is "The constraint function must be a function handle." a valuable hint?

その他の回答 (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