You are on page 1of 3

EEE324 – Digital Signal Processing

Lab Report # 1
“Matlab Review”

Name Huzaifa Yasir Reg # FA19-BEE-112

Class & Section BEE-5D Semester FA-21


Performed Date 21 09 2021 Submitted Date 25 09 2021

Task -1:

>>v=[1 4 7 10 3] >> v(:)


v= ans =
1 4 7 10 3 1
4
7
10
3

Task -2:

It generates linearly spaced vectors.


Syntax:
x= linespace(x1, x2)
Y=linespace(x1, x2, n)
Where n is the no. of points.

>> A = [1 2 3; 4 5 6; 7 8 9] >> A(2,:)


A= ans =
1 2 3 4 5 6
4 5 6 >> A(:,2:3)
7 8 9 ans =
2 3
5 6
8 9

Task -3:

1|Page Department of Electrical & Computer Engineering | CUI Wah


EEE324 – Digital Signal Processing

>> A = [1 2 3; 4 5 6; 7 8 9] >> A(:,2)=[ ]

A= A=
1 2 3 1 3
4 5 6 4 6

7 8 9 7 9
This Command will eliminate the second column of
matrix.

Task -4:

>> A = [1 2 3; 4 5 6; 7 8 9] >> B = A([2 3],[1 2])


A= B=
1 2 3 4 5
4 5 6 7 8
7 8 9

>> size(A)
ans =
3 3

Task -6:

>> t = -5:.01:5;
>> y = sin (2*pi*t);
>> plot (t,y);
>> z = cos (2*pi*t);
>> plot(t,y,'r',t,z,'k')

2|Page Department of Electrical & Computer Engineering | CUI Wah


EEE324 – Digital Signal Processing

Task -7

Stem: Figure:
Plot discrete sequence data Create figure window
Syntax: Syntax:
stem(Y) Figure
stem(X,Y) figure(Name,Value)

Hold: Subplot:
Retain current plot when adding new plots Create axes in tiled position
Syntax: Syntax:
hold on subplot(m,n,p)
hold off
hold all

3|Page Department of Electrical & Computer Engineering | CUI Wah

You might also like