'Not enough input arguments' error in GlobalSearch function
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!