I have a function that gives two outputs, what is the easiest way to use fzero on only the second output

6 次查看(过去 30 天)
I have a function [a,b] = fun(x) when I don't want to change the function. I want to find the value of x for which b returns zero. What is the simplest way to get fzero to work here? Currently my best option is to write a second function
function [b] = fun2(x)
[~,b] = fun(x); return
but there must be a better way.

采纳的回答

David H
David H 2019-10-23
No good way of doing this within Fzero, people have made that clear.

更多回答(1 个)

Matt J
Matt J 2018-2-14
but there must be a better way.
Nope.
  4 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Optimization 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by