Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need the answer in matlab Problem 2: Uniformly accelerated linear motion problem

ID: 668388 • Letter: N

Question

Need the answer in matlab

Problem 2: Uniformly accelerated linear motion problem (motion .m) A car, initially at rest, accelerates at a constant rate of 0.5 m/s^2 for 8 seconds. Write a function, which computes the distance traveled and velocity of the car. The input argument for the function should be time, t. For time. T = 0:0.5:8. generate a table using the f print f command, which lists the time, distance traveled, and velocity of the car. Label the columns of your table and include units. The first line of your function should be: function [dist. veil = motion(t). Hint: Recall the equations of motion for uniform acceleration Run and debug your function to ensure that it works.

Explanation / Answer

function=calculate()
t=0:0.5:8;
fprintf('%6s %12s %18s ','time (s)', 'distance (m/s2)', 'velocity(m/s)');
[d,v]=motion(t)
A=[d,v]
fprintf('%6.2f %12.8f 19.2f ',t,A);
end

function [dist,vel] = motion(t)
   a=0.5;
   dist= 0.5 *a* t*t;
   velocity=a*t;
   end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote