Experiment 3: To Perform Basic MATLAB Operations On Basic Functions
Experiment 3: To Perform Basic MATLAB Operations On Basic Functions
Introduction
In this Matlab lab, you will learn how to:
Generate unit impulse delay (shift) function
Generate unit step delay (shift) function
Generate unit ramp delay (shift) function
Summing unit step and unit ramp function
Subtracting unit step and unit ramp function
Multiplication of the unit step and unit ramp function
Division of unit step and unit ramp function
Generate unit impulse from unit step functions
Generate unit step from unit ramp function
Tools used:
MATLAB
Lab Exercise
Perform the given tasks:
Question 3.1
Code:
t=-2:1:2;
y=[zeros(1,2), ones(1,1), zeros(1,2)];
subplot(2,2,1);
stem(t,y);
ylabel('d(n)');
xlabel('unit impulse');
Plot:
Explanation:
Question 3.2
Code:
n=input('Enter n values');
t=0:1:n-1;
y1=ones(1,n);
subplot(2,2,2);
stem(t,y1);
ylabel('Amplitude');
xlabel('unit step');
Plot:
Explanation:
Question 3.3
Code:
n=input('Enter n values');
t=0:1:n-1;
subplot(2,2,3);
stem(t,t);
ylabel('Amplitude');
xlabel('unit ramp');
Plot:
Explanation:
Question 3.4
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation:
Question 3.5
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation:
Question 3.6
Multiplication of the unit step and unit ramp function?
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation:
Question 3.7
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation:
Question 3.8
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation:
Question 3.9
Generate unit step from unit ramp function?
Code:
< Insert program code here. Copy from m-file(s) and paste. >
Plot:
< Insert program plot here. Copy from Matlab figure and paste. >
Explanation: