function f=fun(x)
f=50*(x(1)+x(2)+x(3))+0.2*(x(1)^2+x(2)^2+x(3)^2)+4*x(1)-160+x(1)+x(2)-100;
a=[1,1,0;0,0,1];
b=[-100;80];
[x,y]=fmincon('fun',rand(3,1),a,b,[],[],[],zeros(2,1),[])
Error using e (line 2)
Not enough input arguments.
function g=test(x);
M=50000;
f=-2*x(1)-3*x(1)^2-3*x(2)-x(2)^2-x(3);
g=f-M*min(x(1),0)-M*min(x(1)+2*x(2)-1,0)+M*abs(x(1)^2-x(3)-2);
[x,y]=fminunc('test',rand(3,1)
Error: File: d.m Line: 5 Column: 31
This statement is incomplete.
f=50*(x(1)+x(2)+x(3))+0.2*(x(1)^2+x(2)^2+x(3)^2)+4*x(1)-160+x(1)+x(2)-100;
a=[1,1,0;0,0,1];
b=[-100;80];
[x,y]=fmincon('fun',rand(3,1),a,b,[],[],[],zeros(2,1),[])
Error using e (line 2)
Not enough input arguments.
function g=test(x);
M=50000;
f=-2*x(1)-3*x(1)^2-3*x(2)-x(2)^2-x(3);
g=f-M*min(x(1),0)-M*min(x(1)+2*x(2)-1,0)+M*abs(x(1)^2-x(3)-2);
[x,y]=fminunc('test',rand(3,1)
Error: File: d.m Line: 5 Column: 31
This statement is incomplete.