fzero with a matrix and solution of previous fzero

2019-07-29 07:36发布

问题:

This is an evolution of the question asked by Immo here

We have a function f(x,y) and we are trying to find the value of x (x*) for a function f(x,y) that produces the function value 0 for a given Y, where Y is a large vector of values.

x* = arrayfun(@(i) fzero(@(x) minme(y(i),x),1),1:numel(y))

What if now I would like to use the x* solution of the arrayfun to find another fzero of the second equation, lets say minme2, that also depends on the same large vector of values Y.

minme2 = @(y,x*, x) x - Y + x* + x* ./ (const1 * (const2 - x*))

Moreover I would like my solutions to dynamically depend on the interval I am selecting for the fzero solution, rather than the initial guess. Instead of 1 I would like my solutions to be found in between:

x0 = [0, min(const1, x*)];

I would appreciate answers how can I solve the minme2 as currently I am facing errors.