Answer to Question #283645 in MatLAB for Jack lakos

Question #283645

The following table shows the acceleration (m/s2) of a vehicle over time. Calculate the velocity (m/s) and the displacement (m) of the vehicle at t=1, 2,….,10 s using trapezoidal rule.

Time (s) Acceleration (m/s2)

0 0

1 1

2 3

3 5

4 8

5 10

6 13

7 15

8 18

9 21

10 25



1
Expert's answer
2021-12-29T17:51:25-0500
% acceleleration (m/s^2):
a = [0, 1, 3, 5, 8, 10, 13, 15, 18, 21, 25];
n =  length(a);

% velocity (m/s):
v = zeros(1, n);
for i=2:n
    v(i) = v(i-1) + (a(i-1) + a(i))/2;
end
disp(v)

% displacement (m):
d = zeros(1, n);
for i=2:n
    d(i) = d(i-1) + (v(i-1) + v(i))/2;
end
disp(d)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS