1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Example with Infeasible solution
function y=fun(x)
y=-sum(exp(x))
endfunction
x0 = [repmat(1,1,20)];
A=[-1,-5,-3 repmat(0,1,17); -0.5,-2.5 -1.5 repmat(0,1,17);];
b=[-100 -50]';
intcon=[1,2];
lb = repmat(0,1,20);
ub = repmat(10,1,20);
// InFeasible Solution.
// hessian =
// []
// gradient =
// []
// exitflag =
// 1
// fopt =
// 0.
// x0pt =
// []
[x0pt,fopt,exitflag,gradient,hessian] = intfmincon(fun,x0,intcon,A,b,[],[],lb,ub)
|