
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
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](https://content.bartleby.com/qna-images/question/80c3b3ad-65a0-4555-a562-b78f9d88ad4e/6bb5b85d-b25e-4960-bdfe-897afc7d1be4/slzbqt_thumbnail.jpeg)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images

Knowledge Booster
Similar questions
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY