I am trying to do the z-transform in matlab but I keep on getting an extremely large answer. Can someone tell me what I am doing wrong? I can do matlab for simply problem but I don't understand the answer it gave me. Why is it so large? if anyone can plug it into matlab and help me it would be great.
MatLab Code
syms z x=(2-((1/sqrt(2))+(sqrt(2)))*z^(-1)+z^(-2))/((1-sqrt(2)z^(-1)+z^(-2))(1-0.5*z^(-1)))
x=iztrans(x)
pretty(x)
x=vpa(x,7)
pretty(x)
ANSWER IN MATLAB x =
0.8092564*0.5^n + (-1.0)^n*(- 0.7071068 - 0.7071068i)^(n - 1.0)0.4604957i - (-1.0)^n(- 0.7071068 + 0.7071068i)^(n - 1.0)0.4604957i + 1.841983(-1.0)^n*cos(2.356194*n) n n n - 1.0 n n - 1.0 n 0.8092564 0.5 + (-1.0) (- 0.7071068 - 0.7071068i) 0.4604957i - (-1.0) (- 0.7071068 + 0.7071068i) 0.4604957i + (-1.0) cos(2.356194 n) 1.841983
Answer in class: y(k) = [0.8093(0.5)^k + 1.3572((1)^k)(cos(0.7854k-0.50047))]u(k)