Lab 1 - Introduction To MATLAB and Time Signals
Lab 1 - Introduction To MATLAB and Time Signals
LABORATORY EXERCISES
Name: ___________________________________ Course: ________ Date: ___________
Yr. & Sec.: Lab. No.: 1 Instructor:
___________ _________________________
I. OBJECTIVES
II. MATERIALS
PC
MATLAB R2022a
III. PROCEDURE
1. When you start MATLAB®, the desktop appears in its default layout.
7. Press the button to start running your program. If there are errors in the codes, an error
message will be displayed in the Command Window.
When there are no errors in the codes. Then, this window will appear.
11. Save it as exp1-3.m and run it. Answer the following questions. What is the result of multiplying
the two signals?
EXERCISES:
PART 1: DISCRETE-TIME SIGNALS
1. Type the following codes and run it.
clc;
clear all;
close all;
num=input('type the numerator vector');
den=input('type the denominator vector');
N= input(' enter the desired length of the output sequence');
n=0:N-1;
imp=[1 zeros(1,N-1)];
H=filter(num, den, imp);
disp(' the response of the system is ');
disp(H);
stem(n,H);
xlabel('n');
ylabel('h(n)');
title(' Signal response');
2. When you run the codes, you will be prompt with the following requirements in the Command
Window?
type the numerator vector [1 3 –3 2 5 –2 2 4 –4]
type the denominator vector 1
enter the desired length of the output sequence 12