Hi to all, I have to solve the following optimization:
theta_cal_const = fmincon(distance , theta0 , [] , [] , [] , [] , lb , ub ,[] ,options );with:distance = @(theta) integral(@(u) integrand(u ,theta),-K, -gap_halfwidth )+ integral(@(u) integrand(u , theta ), gap_halfwidth , K) ;
as a result, matlab returns me the error:
undefined function or method 'integral' for input arguments of type'function_handle'.Error in ==> fmincon at 517 initVals.f = funfcn{3}(X,varargin{:});Error in ==> maxLH at 32theta_cal_const = fmincon(distance , theta0 , [] , [] , [] , [] , lb , ub ,[] ,options );Caused by: Failure in initial user-supplied objective function evaluation. FMINCON cannot continue.
this is the first time i use fmincon, i dont really understant the error message. Thank you for help
Best Answer