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
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
Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
Related questions
Question
Please help me 5
this exercise need to be done by 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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F80c3b3ad-65a0-4555-a562-b78f9d88ad4e%2F7ebaf68f-0a8b-45c3-aa08-ede0aabf660f%2Fdegx5dc_processed.jpeg&w=3840&q=75)
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 step
Solved in 2 steps with 2 images

Recommended textbooks for you

Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON

Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning

Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education

Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON

Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning

Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education

Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education

Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON

Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,