필터 지우기
필터 지우기

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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by