0% found this document useful (0 votes)
28 views3 pages

Syed Imtiaz Ali Shah Reg No 2015436 Section B Dynamics Aqib Ali

This document contains code that defines a function to calculate distance (s) given time (t) as s = 1.5*t^3 - 13.5*t^2 + 22.5*t. It plots the distance-time relationship and calculates the total distance traveled between several time points. The total distance calculated is 69 units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

Syed Imtiaz Ali Shah Reg No 2015436 Section B Dynamics Aqib Ali

This document contains code that defines a function to calculate distance (s) given time (t) as s = 1.5*t^3 - 13.5*t^2 + 22.5*t. It plots the distance-time relationship and calculates the total distance traveled between several time points. The total distance calculated is 69 units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Syed Imtiaz Ali Shah

Reg No 2015436
Section B
Dynamics
Aqib Ali
t = 0:0.5:6
s = 1.5*t.^3-13.5*t.^2+22.5*t
plot(t,s)
xlabel('TIME')
ylabel('DISTANCE')
title('D VS T')

t = 0
s1 = 1.5*t.^3-13.5*t.^2+22.5*t
t = 1

s2 = 1.5*t.^3-13.5*t.^2+22.5*t
t = 5
s3 = 1.5*t.^3-13.5*t.^2+22.5*t
t = 6
s4 = 1.5*t.^3-13.5*t.^2+22.5*t

s = s2 + abs( s3-s2 )+ abs( s4-s3 )

>> assignment
t=

Columns 1 through 11

0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000

Columns 12 through 13

5.5000 6.0000

s=

Columns 1 through 11

0 8.0625 10.5000 8.4375 3.0000 -4.6875 -13.5000 -22.3125 -30.0000 -35.4375 -37.5000

Columns 12 through 13

-35.0625 -27.0000

t= 0
s1 =

t=

s2 =

10.5000

t=

s3 =

-37.5000

t=

s4 =

-27

s=

69
>>

You might also like