Matlab lab 2
- 1. clc
clear all
%% LAB REPORT 2
title(' Discrete Time')
x=[2,1,-1,0,1,4,3,5];
n=[-3,-2,-1,0,1,2,3,4];
subplot(3,3,1)
stem(n,x)
%% Unit Sample Sequence
title('UNIT SAMPLE SEQUENCE')
n1=-10:20;
u=[zeros(1,10) 1 zeros(1,20)];
subplot(3,3,2)
stem(n1,u)
%% unit step function
n2=-10:20;
u1=[zeros(1,10) ones(1,21)];
subplot(3,3,3)
stem(n2,u1)
%%Exponential
n3=0:20;
a1=1.2;
x1=a1.^n3;
subplot(3,2,3)
stem(n3,x1)
%%x(n)= e.^(-0.5+(pi/6j))n for 0 = n = 40
n4=0:40;
c4=-(1/2) + (pi/6)*i;
x4=exp(c4*n4);
subplot(3,3,7);
stem(n4,real(x4))
subplot(3,3,8);
stem(n4,imag(x4))