How do I minimize a function
2 views (last 30 days)
I got an 8th degree equation for a curve through curve fitting toolbox and I have to Minimize it. So how would I understand what parameters are chosen or what kind of function to choose for a particular equation.
Majid Farzaneh on 23 May 2018
Hi, You can use genetic algorithm (ga) like this:
[x, Fval]=ga(@(x) your_fcn(x), N)
N is number of variables in your function. The output contains x (your optimum values for your variables) and Fval (minimum value provided by optimum x). If you have constrains try
Also you can use fmincon. Try