在命令窗口输入
>> A=[-1 -2 -2;1 2 2];
>> b=[0;72];
>> x0=[10;10;10];
>> [x,fval] = fmincon(@myfunction,x0,A,b)
Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In fmincon at 274
??? Error using ==> fmincon
FMINCON cannot continue because user supplied objective function failed with the following error:
Undefined function or variable 'b'.