필터 지우기
필터 지우기

I am trying to compute the zero of a function using fzero, but the system always says my function must be finite and real. How can I solve that? Thank you!

조회 수: 1 (최근 30일)
I want to find the zero of f(x) = 2(3x+4)(x^3+4x^2-10)/(x^2(3x+8)^2)
Here is the screenshot for the error:

채택된 답변

Matt J
Matt J 2021년 9월 24일
편집: Matt J 2021년 9월 24일
Clearly, your function is non-finite at x=0. There is a factor of x^2 in its denominator.
Regardless, fzero() is the wrong tool for analyzing a rational function. Just use roots() to get the roots of the numerator polynomial.
r=[roots([1 0 4 -10]).' ,-4/3];
r=real( r( abs(imag(r))<1e-10 ))
r = 1×2
1.5568 -1.3333
And, of course, you must make sure that none of the numerator roots coincide with any denominator roots, but that is obvious here by inspection.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by