Professional Documents
Culture Documents
x=n==0;
subplot(2,1,1)
plot(n,x)
n1=-5:5;
x1=n1;
subplot(2,1,2)
plot(n1,x1)
TASK2
n=-5:5;
x=n==0;
subplot(2,1,1)
plot(n,x)
switch c
case 1
x1=n==0-s;
subplot(2,1,2)
plot(n,x1)
case 2
x1=n==0+s;
subplot(2,1,2)
plot(n,x1)
end
A.
B.
c.
n=-5:5;
x=n==0;
subplot(2,1,1)
stem(n,x)
switch c
case 1
x1=n==0-s;
subplot(2,1,2)
stem(n,x1)
title('Left shift')
case 2
x1=n==0+s;
subplot(2,1,2)
stem(n,x1)
title('Right shift')
end
Task3:
n=-5:5;
x=n>=0;
subplot(2,1,1)
plot(n,x)
x1=n>=0-s;
subplot(2,1,2)
plot(n,x1)
title('Advance')
n=-5:5;
x=n>=0;
subplot(2,1,1)
stem(n,x)
x1=n>=0-s;
subplot(2,1,2)
stem(n,x1)
title('Advance')
Task4:
n=-5:5;
x=n>=0;
subplot(2,1,1)
stem(n,x)
switch c
case 1
x1=n>=0-s;
subplot(2,1,2)
stem(n,x1)
title('Advance')
case 2
x1=n>=0+s;
subplot(2,1,2)
stem(n,x1)
title('Delay')
end
n=-5:5;
x=n>=0;
subplot(2,1,1)
plot(n,x)
switch c
case 1
x1=n>=0-s;
subplot(2,1,2)
plot(n,x1)
title('Advance')
case 2
x1=n>=0+s;
subplot(2,1,2)
plot(n,x1)
title('Delay')
end
Task5
function[y]=flipadv(x,s)
t=-5:5;
y=flipr(x)
t1=flipr(t)
subplot(3,1,1)
plot(t,x)
subplot(3,1,2)
plot(t1,y)
t2=t1+s
subplot(3,1,3)
plot(t2,y)