Interesting question: construct a polynomial and then evaluate it

In the normal polynomial root-finding, we could utilized the roots(x) function and passed a vector a x for root.
But what if we have some function:
where r is some fixed constant.
In such case, the roots function definitely could not used in this case, how can i supposed to construct such function and then find its root?
Thanks for your assistance.

 采纳的回答

Certainly roots() could be used.
t = a(:) .';
t(r, end) = 0;
t(end-r+1:end) = [];
coeff = fliplr( t );
sols = roots(coeff);

更多回答(1 个)

Substitute x^r = y.
Then the polynomial reads
P(y)=a0+a1*y+a2*y^2+...+a_n*y^n
which has the normal form to be used with MATLAB's roots-function.
Best wishes
Torsten.

1 个评论

You would get out n roots, and then you would have to multiply those by the r roots of unity.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Polynomials 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by