brute force procedure for a function
2 views (last 30 days)
Show older comments
Dear collegues,
I have a question about design of flexiable brute force procedure over functions parameters. suppose I have a function
kpi = func(a,b,c)
in brute force function i want to select only for which parameters optimize and in which range e.g.: Optimization over a = 1:5 and c= 100:125 and b = 2
result = f_opt(@func,[1 0 1], {1:5,2,100:125})
the number of parameters in func must be canchagable. func is not vectorized.
What is the best way to design such function?
0 Comments
Answers (1)
Yu Jiang
on 6 Aug 2014
If you would like to fix one parameter, e.g., b and optimize the function by finding appropriate a and c in their given range, you may try the following
x = fmincon(@(x) func(x(1),b,x(2)), x0, [], [], [], [], [1 100], [5 125])
where x0 is the initial condition.
0 Comments
See Also
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!