fminbnd for multiple parameter function
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a function f(x,y,z). I want to use fminbnd to minimize f(x) given a y and z. I am wondering if there is a neat way of passing this to fminbnd or if I need to write a separate function such as:
g(x) {
g = f(x,1,1);
}
댓글 수: 0
답변 (1개)
Gabo
2011년 6월 7일
I'm a little confused by "write a separate function such as g(x) { g=f(x,1,1);}". But I think a function handle is what you are looking for. Try:
g=@(x)f(x,1,1);
fminbnd(g,x1,x2)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!