How to use fmincon when the objective function is an expression of other functions?.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Edoardo Briganti
el 2 de Mzo. de 2017
Comentada: Edoardo Briganti
el 2 de Mzo. de 2017
I am trying to minimize a function of two variables (defined over a compact interval [0,1]) using fmincon. However the objective function is really complicated in terms of length. I am trying to avoid writing it entirely by splitting it in shorter expressions. For instance, suppose my objective function is
fun=@(x) (x(1).^2+2)./(sqrt(x(2)+1))
What I am trying to do is to define, say
F1=@(x)(x(1).^2+2)
F2=@(x)(sqrt(x(2)+1))
and then minimize this new objective function fun=@(x)F1./F2
Is it possible to do it?
Thanks in advance
Edoardo
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!