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

12 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

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

Weitere Antworten (1)

Matt J
Matt J am 14 Feb. 2018
but there must be a better way.
Nope.
  4 Kommentare

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Optimization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by