Same functionality as Excel Solver to set objective to a value
Show older comments
Hi all
I am currently going through a process of taking an existing calculation perfomed within Excel and transferring it to MATLAB. Part of the existing calculation is to use Excel Solver to optimise two factors to allow a value to be calculated which matches a target value. This was achieved in the Excel solver by setting the objective to a fixed value using the 'Value Of' input box.
Going through the MATLAB optimisation functions I can only find solutions to minimise the value. My question is what function would I use to target a value? Note that I do not have the optimisation toolbox installed.
Many Thanks
Peter
Accepted Answer
More Answers (1)
Titus Edelhofer
on 7 Jun 2012
Hi Peter,
to optimize a variable to be of value XTarget, you need to minimize the function
abs(x - XTarget)
If you don't have restrictions, you can use fminsearch as solver.
Titus
Categories
Find more on Solver Outputs and Iterative Display 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!