You are on page 1of 4

EEE223 – Signals and Systems

Lab Report # 1
Lab. Experiment Name

Name Muhammad Abdullah Reg # FA17-BEE-081

Class & Section BEE-4D Semester SP-19


Performed Date 13 02 2019 Submitted Date 23 02 2019

Task -1:
What does the following command do?

v(:)
ANS: This command is used to show the whole matrix or row given convert into single column.
e.g
x=

1 2 3

4 5 6

>> x(:)

ans =

Task -2: Explain the command linspace?


ANS: Linspace is used to declear Hundred value between the two number by default if you do not
mansion the gap between two values if you mansion the gap value that what you want between the two
number

e.g y=linspace(2,3,5)

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


EEE223 – Signals and Systems

y=

2.0000 2.2500 2.5000 2.7500 3.0000

Task -3: >> A(2,:)


Here colon ca acess all the column in given matrix

e.g

A= 1 2 3

4 5 6

7 8 9

>> A(2,:)

ans =

4 5 6

>> A(:,2:3)
Here row can be access through out the given matrix in the given command here we access the all
rows of the matrix but 2nd and 3rd column will be access.

e.g

A(:,2:3)

ans =

2 3

5 6

8 9

Task (3): Explain the output of the following commands?


>> A = [1 2 3; 4 5 6; 7 8 9]
OUTPUT
A=
1 2 3
4 5 6
7 8 9
2|Page Department of Electrical & Computer Engineering | CUI Wah
EEE223 – Signals and Systems

After 3 terminator terminate the value so 4 comes in next row so similarly after 6 terminator come and
it terminate the value in next row.

>> B = A([2 3],[1 2])


Output
B=

4 5

7 8

As [2 3] mean 2nd and 3rd row access and [1 2] mean 1st and 2nd column access in the upper given matrix.

size(A)
ans =

3 3

Size command give the total size of row and column in a matrix so upper matrix have 3*3 dimension.

Task (4): Type the following commands and observe the plot
t = -5:.01:5;
y = sin (2*pi*t);
plot (t,y);
z = cos (2*pi*t);
plot(t,y,'r',t,z,'k')
output

Task (5):Explain the following functions

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


EEE223 – Signals and Systems

Stem:
Basically stem command is used for discrete time graph it make the patch of continuous graph so it
show us the discrete value

Figure
If we draw more then one graph and we want to draw in more then one graph for comparison
so we used figure command so we see the 2 different figure.
Hold
Hold command is used stop or retain the graph to draw another graph to show the only one graph so it
it’s only possible in Discrete time graph

Subplot
Subplot command is used to draw more then one graph in one figure to compare in same figure and if
you draw more then one graph so using this command we can plot more then one graph .

END

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

You might also like