I have a function that gives two outputs, what is the easiest way to use fzero on only the second output
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
David H
el 14 de Feb. de 2018
Respondida: David H
el 23 de Oct. de 2019
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.
Respuesta aceptada
Más respuestas (1)
Matt J
el 14 de Feb. de 2018
but there must be a better way.
Nope.
4 comentarios
Simona Giglioli
el 23 de Oct. de 2019
But then if I use fzero in the main code, it doesn't recognise the function
Ver también
Categorías
Más información sobre Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!