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);
}

回答(1 个)

Gabo
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)
See also the examples in fminbnd.

类别

Help CenterFile Exchange 中查找有关 External Language Interfaces 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by