Polynomials - expand (s-p1)*(s-​p2)*(s-p3)​...(s-pn-1​) and find the coefficients an-1, ... , a2, a1, a0 of s^n + an-1*s^n-1 + ... + a2*s^2 + a1*s + a0

2 次查看(过去 30 天)
given: (s-p1)*(s-p2)*(s-p3)...(s-pn-1)
find an-1, ... , a2, a1, a0 of s^n + an-1*s^n-1 + ... + a2*s^2 + a1*s + a0
How can I solve this with matlab? If I enter for example syms s and (s - 1)*(s - 2)*(s - 3)*(s - 4) in the command window the answer is (s - 1)*(s - 2)*(s - 3)*(s - 4).
Thanks for helping.
Best regards Michael

采纳的回答

Wayne King
Wayne King 2011-9-21
Hi Michael, How about using expand()
syms s
p = (s - 1)*(s - 2)*(s - 3)*(s - 4);
expand(p)

更多回答(1 个)

Michael Groncki
Michael Groncki 2011-9-21
@Wayne: Thanks for your help.
In a second step I used sym2poly for the coefficients: sym2poly(expand(p))

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by