How to use fmincon with arrays?

Hi - I’m trying to resolve the optimal solution for a function that receive 2 arrays... and every element are limited by a min/max value (2 set of min/max)
I have look at fminsearch... but I can’t figure out how to put a min/max on the inputs.
I also did look at fmincon... but i cant figure how i could use an array (let alone 2 arrays)
Any advices?
Thanks in advance for your help.

Respuestas (1)

Matt J
Matt J el 20 de Jun. de 2013
Editada: Matt J el 20 de Jun. de 2013

0 votos

I also did look at fmincon... but i cant figure how i could use an array (let alone 2 arrays)
You must combine the 2 arrays into a bigger array and write your objective function and the rest of your problem data in terms of this larger array. FMINSEARCH would have required you to do the same thing, even without the bounds, so since you say you understand how to make fminsearch work with arrays, it should be no different for fmincon.

Etiquetas

Preguntada:

ben
el 20 de Jun. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by