MATLAB: Using fmincon function for optimisation

fminconoptimisation

Hey, I was wondering if anyone could explain this. I am using fmincon function for optimisation but gets the following error: Error using fmincon (line 220) FMINCON requires the following inputs to be of data type double: 'Aeq','Beq'.
Error in OptimisationCode1 (line 112) [xalpha,fval,flag]=fmincon(gap,xalphakeep,alphamin,alphamax,@nonlconstr,options);
But I believe both alphamin and alphamax are defined as double by default. Could you please suggest any alternatives?
Ajmal Roshan

Best Answer

[xalpha,fval,flag]=fmincon(gap,xalphakeep,[],[],[],[],alphamin,alphamax,@nonlconstr,options);
alphamin and alphamax must be vectors of size "xalphakeep".
Best wishes
Torsten.
Related Question