You are on page 1of 10

n=-5:5;

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)

c=input('enter case: ')


s=input('enter sample: ')

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)

c=input('enter case: ')


s=input('enter sample: ')

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)

s=input('enter sample: ')

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)

s=input('enter sample: ')

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)

c=input('enter case: ')


s=input('enter sample: ')

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)

c=input('enter case: ')


s=input('enter sample: ')

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)

You might also like