Matlab extract coefficient from z transform function

12 次查看(过去 30 天)
Hi I have a z transform function 3/z + 5/z^2 + 6/z^3 + 1
How would I extract the coefficients from this equation? I have tried using coeffs and it says it is not a polynomial.
I would like the answer to come out as [3 5 6 1]
The symbolic z variable is declared as syms z

采纳的回答

Star Strider
Star Strider 2014-5-10
编辑:Star Strider 2014-5-10
Use the sym2poly function, although here it’s necesary to do an intermediate step:
syms z
fz = 3/z + 5/z^2 + 6/z^3 + 1
[fzn, fzd] = numden(fz)
fzc = sym2poly(fzn)
fzc = circshift(fzc, [0 -1])
produces:
fzc =
3 5 6 1
  2 个评论
David
David 2014-5-10
Thank you so much for your input. It was exactly what I was looking for.
Star Strider
Star Strider 2014-5-10
My pleasure!
The sym3poly function would work with a ‘normal’ polynomial, but the symbolic terms in the denominator require numden and then circshift.

请先登录,再进行评论。

更多回答(0 个)

类别

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