I have a polynomial, y(x)=a0+a1*x^1+a2*x^2+a3*x^3+a4*x^4+......+an*x^n.
of the degree n
, where ai
is a real number.
My question is, is there a function in matlab that I can use to find the range of x
for all y(x)>0
?
I have a polynomial, y(x)=a0+a1*x^1+a2*x^2+a3*x^3+a4*x^4+......+an*x^n.
of the degree n
, where ai
is a real number.
My question is, is there a function in matlab that I can use to find the range of x
for all y(x)>0
?
No there is no explicit function that does this. However, as long as you desire a numerical solution, it is possible.
You can solve for the roots of y(x). (hint: roots)
What happens between any pair of roots? What happens above and below the largest and smallest real roots? What can you do with any roots that are complex?
I can't think of a function but I would do the following:
roots
.Additionally, if you want visualize your answers, you can plot your polynomial with ezplot
. E.g. ezplot('5*x^3 + 4*x^2 + 3*x + 2');