0
votes

I have some function f(x), where x is a six-element vector. I want to find a minimum of this function using

x = fmincon(fun,x0,A,B)

I have the following constraints:

a*x1<b*x2<c*x3 and d*x4<e*x5, where a,b,c,d,e are some numbers.

My problem is to write A and B parameters of fmincon function correctly.

Could you help me?

Update

My problem is that I don't understand how to join inequalities: if I want to use only ax1<bx2 then A=[a,-b,0,0,0]; B=0, if I want to use bx2<cx3, then A=[0,b,-c,0,0]; B=0. But I could not join these constraints.

May I use A=[[a,-b,0,0,0],[0;b;-c;0;0]]; B = [0,0];?

1
what have you tried and why does it not work? - Ander Biguri
Have you tried what you ask? have you read the documentation (where it is explained)? What did you not understand from the documentation? - Ander Biguri

1 Answers

1
votes

You can try the constraint matrix A and vector B like below

A = [a,-b,0,0,0;
     0,b,-c,0,0;
     0,0,0,d,-e];

B = zeros(3,1);