fzero error ( complex function encountered)
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numeric Solvers에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
