How to minimise a function with three input arguments in least squared sense in MATLAB ?
1 view (last 30 days)
Show older comments
I was having a look at the x = lsqnonlin(fun,x0,lb,ub) command in Matlab. But as the syntax shows, the function 'fun' has only one variable 'x' whose initial value is x0 and optimised lb < x < ub. But what If I have a function with three input variables. All the three variables have upper and lower limits respectively. And my objective is to minimise the function with optimal values of these three variables within the specified range. Eg: t = function(x,y,z) I would like to find optimal values of x,y, and z such that value of t is minimised.
0 Comments
Answers (1)
Torsten
on 20 Mar 2015
x0, lb and ub are not necessarily scalars, but can also be vectors of length 3 ...
Best wishes
Torsten.
2 Comments
Torsten
on 24 Mar 2015
Then pass a new function to lsqnonlin in which you call your symbolic function n times to compute the vector (f1,f2,...,fn).
Best wishes
Torsten.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!