How to use fmincon with arrays?
Show older comments
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.
Answers (1)
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.
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!