1]; A = [1, 2]; b = 2; % 调用fmincon进行求解 [x, fval, exitflag] = fmincon(fun, ...
exitflag=-2%%就是说没有在你的数据范围内找到最优点,优化失败!
matlab优化中,..function f=objfun(x)f=x(1).^3*x(2)*x(3)/x(4)*(4.2*x(2)/x(4)+2)*(3.2*x(2)/x(4)+2);function [c,ceq]=co
getting exit message 2 is not bad but if you insist on having 1, you could try to use smaller values for TolX (ie.. 1e-10 or even 1e-14) as for exit message -2: there could be many causes. if you choose a feasible starting point, fmincon should be able to ...