You are on page 1of 1

%Unit sample sequence

function[x n]=ImpScq(n0,n1,n2)
n=[n1:n2];
x=[(n-n0)==0];
end

%unit step seq


a=2*ImpScq(-2,-5,5);
b=ImpScq(4,-5,5);
z=a-b;
stem (n,z);
title('Unit sample sequence');
xlabel('n')
ylabel('amp')

%Unit step sequence


function[x n]=question2(n0,n1,n2)
n=[n1:n2];
x=[(n<n0)==0];
end

%complex exp signal


x1=5exp(i*n*pi/4);
n[-50:50];
plot (n,x1);

You might also like