clc;

clear all;

close all;

f=input('enter the sine wave frequency f = ');

a=input('Enter the value of a= ');

n=0:0.5:20;

syms f n a;

x1=cos(2*pi*(f)*n).*exp(-a*n);

z = ztrans(x1);

pretty(z)

%Solves the Z transform equation

ZtranSolu = collect(z);

%Extracting numerator and denominator

[num,den] = numden(ZtranSolu);

num

den

ts = 0.9; % Sampling period

H = tf(sym2poly(num),sym2poly(den),ts)

% To plot the pole's and zero's of z transform

figure('name','Pole Zero Plot')

pzmap(H)

--------------------------------------------------------------------------

I am getting the following error

Error using sym/sym2poly

Not a polynomial.

Error in test

H = tf(sym2poly(num),sym2poly(den))

More Ladi Sandeep Kumar's questions See All
Similar questions and discussions