Sunday, 21 October 2012

Z Transform in MATLAB


Just create a new file with extension .m and paste the code below in that .m file. Then Run it. 

 clear all;
clc;
syms z;
x=input('enter the sequence x(n) : ');

s=input('enter the starting interval of x(n) : ');
l=length(x);
sum=0;
    for n=s:1:l+s-1
    sum=sum+x(n-s+1)*z^(-n);
    end
sum

No comments:

Post a Comment

Tech N Science © 2013