How can we minimise a three-inpu​t-argument​s-function in MATLAB? Given is the function and the lower and upper value limits of the three input variables.

I have a function f which depends on three variables namely x,y and z. I have the lower and upper limits of x,y and z respectively. So how do I minimise the function f and find the values of x , y and z when the function is minimum. As far as I understand, the function "fmincon" is used only for single input variable. So I kindly request to provide some clarity on the solution.

3 Comments

fmincon deals with arbitrary dimensions.
Best wishes
Torsten.
Hello Torsten, Could you please comment about the solution !
fun=@(x)(x(1)^2+x(2)^2+x(3)^2);
lb=[1;1;21];
ub=[2;2;25];
x0=[1;1;22];
x = fmincon(fun,x0,[],[],[],[],lb,ub)
Best wishes
Torsten.

Answers (0)

This question is closed.

Asked:

on 23 Mar 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!