Error when using residue function
Show older comments
Please tell me if there's something with my code or it just because of the function "residue"
syms z
dz = (2*z + 1)^4*(3*z + 1)^2*(z + 1)^3;
% get all coefficients of the above polynomial, dz (largest degree --> smallest one)
cs = fliplr( double(coeffs(fz)) );
% partial fraction decomposition of "1/dz" using "residue" function
[r,p,k] = residue(1,cs);
The result shows that
p = [-1.0000 -1.0000 -1.0000 -0.5005 -0.5005 -0.4995 -0.4995 -0.3333 -0.3333]
However, should it be like this to be correct? (notice the differences of the 4th-7th elements in two results)
p = [-1.0000 -1.0000 -1.0000 -0.5000 -0.5000 -0.5000 -0.5000 -0.3333 -0.3333]
Also by using r,p,k achieved from "residue" function, I cannot convert the partial fraction expansion back to polynomial coefficients. How can I fix it?
2 Comments
Jan
on 6 Dec 2017
Please explain, why you assume that the second value of p is correct.
Luan Nguyen Thanh
on 6 Dec 2017
Edited: Luan Nguyen Thanh
on 6 Dec 2017
Answers (1)
Star Strider
on 6 Dec 2017
0 votes
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!