Develop an m. file to compute velocity as a function of t. Then develop a script that uses this function to generate a plot of velocity versus time for t= -5 to 50. v(t)=    10t^2 -5t, 0<=t<=8              624-3t,   8<=t,+16            36t +12(t-16)^2, 16<=t<=26             2136e^(-0.1(t-26)),  t>26              0,     otherwise

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
100%

Develop an m. file to compute velocity as a function of t. Then develop a script that uses this function to generate a plot of velocity versus time for t= -5 to 50.

v(t)=    10t^2 -5t, 0<=t<=8

             624-3t,   8<=t,+16

           36t +12(t-16)^2, 16<=t<=26

            2136e^(-0.1(t-26)),  t>26

             0,     otherwise

Expert Solution
Step 1

Code:

t=input('Enter time: ')
x=-5:50
if(t>=0 && t<=8)
    velocity=10*t^2-5*t
    f1=10*x.^2-5*x
    plot(x,f1)
elseif(t>=8 && t<=16)
        velocity=624-3*t
        plot(x,624-3*x)
elseif(t>=16 && t<=26)
        velocity=36*t+12*(t-16)^2
        plot(x,36*x+12*(x-16).^2)
elseif(t>26)
        velocity=2136*(exp^(-0.1*(t-26)))
        plot(x,2136*(exp^(-0.1*(x-26))))
else
    velocity=0
    plot(x,0)
end

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
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