brute force procedure for a function

조회 수: 7 (최근 30일)
Alexey
Alexey 2014년 8월 6일
답변: Yu Jiang 2014년 8월 6일
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?

답변 (1개)

Yu Jiang
Yu Jiang 2014년 8월 6일
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.

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by