'Not enough input arguments' error in GlobalSearch function
이전 댓글 표시
I am trying to obtain global minima for a function using fmincon and globalsearch functions. But, there seems to be some error in function definition when I use CreateOptimProblem command. The error is
Not enough input arguments.
Error in inclndbackfill_inclinedwall>inclinedbckfill_inclwall (line 37)
alps(1:M)=X(1:M);
Code is given below. ( the function code is really big, so i m not including the entire one)
N=4; M=3;
A=[]; b=[];
Aeq=[]; Beq=[];
x0=[0*ones(1,M) 0*ones(1,N)]; lb=[0*ones(1,M) 0*ones(1,N)]; ub=[1.57*ones(1,M) 1.57*ones(1,N)];
opts=optimoptions(@fmincon,'Algorithm','sqp');
problem=createOptimProblem('fmincon','objective',inclinedbckfill_inclwall,'x0',x0,'lb',lb,'ub',ub,'options',opts);
gs=GlobalSearch;
[x,fval]=run(gs,problem);
function f=inclinedbckfill_inclwall(X)
N=4;
M=3;
alps(1:M)=X(1:M);
alp(1:N)=X(M+1:M+N);
...................................
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!