Professional Documents
Culture Documents
03-Circuit Analysis Lab
03-Circuit Analysis Lab
Appropriately Inappropriately
Efficiently recorded
recorded some recorded Cannot record
all observations
observations with observations with observations with
Organization including
units/graph/truth units/graph/truth units/graph/truth
& content. units/graph/truth
table etc. less table etc. non- table etc. coherently
table etc. coherently.
coherently. coherently.
Satisfactorily
Well-presented
presented results Inefficiently
results and Not presented results
and conclusion in a presented results
Result & conclusion and conclusion
less coherent and conclusion in a
conclusion. incoherent manner incoherent manner
manner with non-coherent
with proper syntax
syntax manner
Marks (out of 12)
Final lab marks (out of __ )
Time Shows excellent time Shows moderate time Shows minimal time Shows, no time
Management management. management. management. management
Marks (out of 6)
Final lab marks (out of __ )
OBJECT:
Plot the graph of unit step function expression in MATLAB, and also get familiar with the
Heaviside command.
LEARNING OUTCOME:
In this lab, students will be able to understand:
Plot unit step function.
Use the Heaviside command for unit step signal.
{
u ( t )= t<0 :0 ,
t ≥ 0:1
The function u(t ) is not defined at t=0. Often we will not worry about the value of a function at
a point where it is discontinuous, since often it doesn’t matter.
The function u(t ) turns on at t=0. Thus function u(t−a) is just u(t ) shifted, or dragged, so that
it turns on at t=a .
The function 1−u (t−b) turns off at t=b .
The function u ( t−a ) −u ( t−b ) , with a< b, turns on at t=a and turns off at t =b .
{
u ( t )= t<0 :0 ,
t ≥ 0:1
SOURCE CODE:
t=(-2:0.01:7)';
z=(t>=0);
plot(t,z)
title('unit step response')
axis([-2.2 8 -0.2 1.2])
GRAPH:
unit step response
1.2
0.8
0.6
0.4
0.2
-0.2
-2 -1 0 1 2 3 4 5 6 7 8
SOURCE CODE:
t=(-2:0.01:7)';
z=(t>=2&t<4)|(t>=5&t<6);
plot(t,z)
title('unit step response')
axis([-2.2 8 -0.2 1.2])
GRAPH:
unit step response
1.2
0.8
0.6
0.4
0.2
-0.2
-2 -1 0 1 2 3 4 5 6 7 8
EXPRESSION:
z=u ( t+ 1 )−u ( t−3 ) +u ( t−5 )−u (t−6)
Whereas:
t = (-2:0.01:7)’;
SOURCE CODE:
GRAPH:
1.1. GRAPH:
unit step response
1.2
0.8
0.6
0.4
0.2
-0.2
-2 -1 0 1 2 3 4 5 6 7 8
Whereas:
t = (-2:0.01:7)’;
EXPRESSION:
{
u ( t )= t<0 :0 ,
t ≥ 0:1
The function u(t ) is not defined at t=0. Often we will not worry about the value of a function at
a point where it is discontinuous, since often it doesn’t matter.
EXPRESSION:
z=−2−2u ( t−1 ) +7 u ( t−2 )−4 u ( t−3 ) +u(t−5)
SOURCE CODE:
m=-10:0.0005:10;
v=0;
sympref('HeavisideAtOrigin', v);
y=-2-2*heaviside(m-1)+7*heaviside(m-2)-4*heaviside(m-3)+heaviside(m-5);
plot(m,y)
axis([-10 10 -5 6])
GRAPH:
6
1 X: 5.046
Y: 0
0
-1
-2
-3
-4
-5
-10 -8 -6 -4 -2 0 2 4 6 8 10
GRAPH:
-1
-2
-3
-4
-10 -8 -6 -4 -2 0 2 4 6 8 10
SOURCE CODE:
EXPRESSION: