SNS Lab 3
SNS Lab 3
SNS Lab 3
MATLAB Code:
% A
t=-5:0.5:5;
x1 = (heaviside (t-1)+heaviside(-t+1));
figure;
xlabel('x'); ylabel('y');
figure;
xlabel('x'); ylabel('y');
% B
n = -5:0.5:5;
figure;
x2 = (kr(n+1) - kr(n-1));
xlabel('x'); ylabel('y');
figure;
xlabel('x'); ylabel('y');
% C
x3 = (cos(t) + sin(t));
figure;
xlabel('x'); ylabel('y');
figure;
xlabel('x'); ylabel('y');
Output:
plot te plot to
2 2
1.5 1.5
1 1
0.5
y
0.5
y
0 0
-0.5 -0.5
-1 -1
0 5 10 15 20 25 0 5 10 15 20 25
x x
1.5 1.5
1 1
0.5 0.5
0
y
0
y
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
0 5 10 15 20 25 0 5 10 15 20 25
x x
0.8
1.5
0.6
1
0.4
0.2 0.5
0
y
0
y
-0.2
-0.5
-0.4
-1
-0.6
-1.5
-0.8
-1 -2
0 5 10 15 20 25 0 5 10 15 20 25
x x
Task 02:
MATLAB Code:
syms n N %Define Variables
x1 = 1;
%Power Eqution
P1=limit(1/((2*N)+1)*symsum((x1)^2,n,0,N),N,inf)
x2 = 2.^-n;
%Power Eqution
P2=limit(1/((2*N)+1)*symsum((x2)^2,n,0,N),N,inf)
Output: