Optimization of one output of a vectorfunction using fminunc

1 次查看(过去 30 天)
Hi!
Last time I got a very helpful idea. Now I defined a vectorfunction which has several variables x1,x2,x3,u1,u2 and also several outputs y1,y2,y3,...,yN. Now I would like to optimize only one output, i.e. I optimize f.ex. only y3. In my case y3 is a function that I get from y1,y2... .
I tried to find the answer, but mostly fminunc were used to optimize y or y1,y2,y3,..... What is the command in the fminunc solver to optimize only one output?
Thanks

采纳的回答

Sean de Wolski
Sean de Wolski 2015-2-3
Inside of your objective function, only return that output:
function y3 = myobjfun(x)
% do whatever
y3 = something;
end
  5 个评论
Michael Haderlein
Your efficiency function obviously returns an array. It must be a scalar though. Maybe you actually want to optimize w.r.t. norm(efficiency)?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by