how I Found the minimum of function using the fminbnd ??

f(x)=3x1+2x1x2+x2 such as 0.1≤ x1 ≤1 0.25 ≤ x2 ≤ 4 help me please thanks in advance

Answers (2)

You cannot do that. fminbnd() can only be used for a function of a single variable.

1 Comment

fun = @(x) 3*x(1) + 2*x(1)*x(2) + x(2)
x0 = [.5 2.5];
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0.1 0.25];
ub = [1 4];
x12 = fmincon(fun, x0, A, b, Aeq, beq, lb, ub)
x1 = x12(1); x2 = x12(2);

Sign in to comment.

You can't. fminbnd is for functions of one variable - your f is a function of two variables.
Use "fmincon" instead.
Best wishes
Torsten.

7 Comments

thanks for your help please how I found the minimum of the function f by using fmincon ?? can you help me thanks in advance
lb = [0.1 0.25];
ub = [1 4];
fun = @(x) 3*x(1)+2*x(1)*x(2)+x(2);
x0 = [0.5 2];
sol = fmincon(fun,x0,[],[],[],[],lb,ub)
If your problem is quadratic (like this test example), MATLAB's "quadprog" is an alternative to "fmincon".
Best wishes
Torsten.
excuse me c'est quoi x0???
initial guess for the solution "sol"
Here is the relevant documentation:
another question please !!!!
if 90x1 ≤120
2900 x2 ≤ 5800
the x0 is equal what??
In principle, x0 is arbitrary.
But if you know an x0 that is feasible and near to the optimum, you should use it since you'll most probably get faster and more stable convergence towards the solution.
thanks a lot and best regards

Sign in to comment.

Categories

Find more on Biological and Health Sciences in Help Center and File Exchange

Tags

Asked:

on 7 Jun 2018

Edited:

on 7 Jun 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!