function [f1,f2,f3,f4,f5] = constraints(x,y)
syms x; y = 0:0.01:0.9;
f1 = @(x) 2*x;
f2 = @(y) 5*y;
f3 = @(x) f1(x)^2;
f4 = integral(f3,0,1);
f5 = @(x) f1(x) + f1(x).^3;
if f4>0
f2 = f2 +1;
else f2 = f2 -1;
end
end
So , these are my constraints. The control variable t though, as seen in the constraints, is not included in them (nonlcon must contain the varialble to be optimized). Therefore
t = fmincon(objective,0,[],[],[],[],0,10,constraints)
doesn't work. A more appropriate syntax would be
t = fmincon(problem)
but there are not enough information for this syntax, or I haven't found anything useful.
If someone has any example would be great.
Thank you for your answers so far.