Exercise 5: Unit step function (for command) (a) Plot the following unit step function between -20 to +20 with step size 0.01 u(t)=1 t < 0 u(t)=0 t≥ 0 (b) Restrict the plot between -5 and +15 on x-axis and -1.5 to +1.5 by using axis command axis ([-5 +15 -2 +2]). Also write your IDs in the title

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please help me with the exercise 5

using matlab

Exercise 5: Unit step function (for command)
(a) Plot the following unit step function between -20 to +20 with step
size 0.01
u(t)=1 t < 0
u(t)=0 t≥0
(b) Restrict the plot between -5 and +15 on x-axis and −1.5 to +1.5
by using axis command
axis([-5 +15 -2 +2]). Also write your IDs in the title
Hint: Some helpful commands
%%Step size and timing%%%
T1=-20;
T2=20;
Dt=0.01;
%% Definition of Unit step
signal %%%
n=1;
for t-T1: Dt: T2
if t<0
T (n)=t;
U (n) = 0;
n=n+1;
end
if t>=0
T (n)=t;
U (n)=1;
n=n+1;
end
end
(1)
1.5
1
0.5
0
-0.5
-1
-1.5
-5
0
ID 4111111, 3111111
U(t)
5
Time (seconds)
1
10
0.9
0.8
0.7
0.6
0.5
0.4
0.3
Part b
Add following command after the plot to adjust the axis. Put your IDs
in title
axis ([-5
+15 -1.5 +1.5])
0.2
0.1
0
-20
-15
-10
Unit Step Function
15
0
Time (seconds)
-5
5
10
15
20
Transcribed Image Text:Exercise 5: Unit step function (for command) (a) Plot the following unit step function between -20 to +20 with step size 0.01 u(t)=1 t < 0 u(t)=0 t≥0 (b) Restrict the plot between -5 and +15 on x-axis and −1.5 to +1.5 by using axis command axis([-5 +15 -2 +2]). Also write your IDs in the title Hint: Some helpful commands %%Step size and timing%%% T1=-20; T2=20; Dt=0.01; %% Definition of Unit step signal %%% n=1; for t-T1: Dt: T2 if t<0 T (n)=t; U (n) = 0; n=n+1; end if t>=0 T (n)=t; U (n)=1; n=n+1; end end (1) 1.5 1 0.5 0 -0.5 -1 -1.5 -5 0 ID 4111111, 3111111 U(t) 5 Time (seconds) 1 10 0.9 0.8 0.7 0.6 0.5 0.4 0.3 Part b Add following command after the plot to adjust the axis. Put your IDs in title axis ([-5 +15 -1.5 +1.5]) 0.2 0.1 0 -20 -15 -10 Unit Step Function 15 0 Time (seconds) -5 5 10 15 20
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY