%3a)
n=[-12:10]';
x=zeros(size(n));
ind=find(n==-5);
x(ind)=0.8
stem(n,x);
num_samples=length(x)
title('Lab1-Plot#3a')
xlabel('Time-index,n');
ylabel('Amplitude');
grid on

num_samples =23

%3b
n=[300:350]';
x=zeros(size(n));
ind=find(n==335);
x(ind)=1
stem(n,x);
num_samples=length(x)
title('Lab1-Plot#3b')
xlabel('Time-index,n');
ylabel('Amplitude');
grid on

num_samples =51

%3c
n=[-12:4]';
x1=zeros(size(n));
x2=zeros(size(n));
ind1=find(n==-4);
ind2=find(n==3);
x1(ind1)=4.5;
x2(ind2)=-1.5;
x=x1+x2;
stem(n,x)
num_samples=length(x)
title('Lab1-Plot #3c')
xlabel('Time-index,n');
ylabel('Amplitude');
grid on

num_samples = 17

%3d
n=[-5:20]';
x=zeros(size(n));
ind=find(n>=0 & n<=9);
x(ind)=1;
stem(n,x)
num_samples=length(x)
title('Lab1-Plot #3d');
xlabel('Time-index,n');
ylabel('Amplitude');
grid on

num_samples = 26

