brute force procedure for a function
조회 수: 7 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File 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!