oml

1、匿名函数提供了一种向要用作参数的函数传递附加参数的方法。考虑以下场景:

function result = ObjFunc(p, data)
...
end

init = [5,3]
data = [2,3,5,7];
[x,fval] = fminunc(@ObjFunc, init)

posted @ 2023-01-27 10:43  洛必达很忙  阅读(476)  评论(0)    收藏  举报