fzero error ( complex function encountered)
Show older comments
Hi experts,
I am using fzero command to solve a nonlinear equation. The function part is as the following, where x is the variable to be solved, e is a variable value that passed to the function (e is a vector, I have a loop outside the nonlinear function for that), and others are parameters:
function F = solvex(x,e)
global alpha eta delta w r mu chi
F= x - w^(-alpha/(1-eta)).*(r+mu*(1-chi*exp(x))).^((alpha*eta-1)/(1-eta)).*exp(e);
end
I got the following error message under some parameter values and e values:
Exiting fzero: aborting search for an interval containing a sign change because complex function value encountered during search.
I checked some answers in mathworks and it seems that because the A^B operator in matlab.
I am looking forward to figuring out the solution. Thank you very much
Accepted Answer
More Answers (0)
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!