[Solved] Need Third Part Answered Code Equations Exq1m T 0 1e 2 10 X1 5 T 2 Y1 Zeros 1 Length X1 X2 Q37219562
I only need the third part answered.
The code for the equations (ExQ1.m) is:
t=0:1e-2:10;
x1=5-t/2;
y1=zeros(1,length(x1));
x2=zeros(1,length(t));
y2=6-7*t/10;
x3=6*cos(pi*t/4);
y3=6*sin(pi*t/4)+6;
plot(x1,y1,x2,y2,x3,y3);
legend(‘First’,’Second’,’Third’)

Three trains travel according to the following relationships on train tracks. x,(t) 5(km) )0 (km) and 2(t)0 (km) 7t 60k) 2)62 and x3 (t) 6cos (km) y, (t)-6 sin(5) + 6 (km) Within the MATLAB script, ExQ1.m, plot each train’s position as a function of time, using vectorization, with 0 sts 10 sec. Use a step of 10 ms. Create a figure ExQ1 1.fig labelling each axis for all three target trajectories. Include a legend that depicts each target. Use vectorization methods in formulating your solution. The train station is located at the origin. Compute the distance between each train and the train station and plot the three results on another figure ExQ1_2.fig. The equation for the distance between a train station and the nh train is m(t)-Vx2(t) + y2(t) (km) . Using logical vectorization determine the first time and last time where the distance between all three trains and the train station is less than 2 km. Finally, within ExQ1.m determine the distance between trains 1 and 2 using the equation r12(t) x1x2)2 + (V1 -V2)2 (km) Determine the minimum distance between the two trains and record it as a comment in your code. Also, determine the time when the minimum distance is achieved. Show transcribed image text Three trains travel according to the following relationships on train tracks. x,(t) 5(km) )0 (km) and 2(t)0 (km) 7t 60k) 2)62 and x3 (t) 6cos (km) y, (t)-6 sin(5) + 6 (km) Within the MATLAB script, ExQ1.m, plot each train’s position as a function of time, using vectorization, with 0 sts 10 sec. Use a step of 10 ms. Create a figure ExQ1 1.fig labelling each axis for all three target trajectories. Include a legend that depicts each target. Use vectorization methods in formulating your solution. The train station is located at the origin. Compute the distance between each train and the train station and plot the three results on another figure ExQ1_2.fig. The equation for the distance between a train station and the nh train is m(t)-Vx2(t) + y2(t) (km) . Using logical vectorization determine the first time and last time where the distance between all three trains and the train station is less than 2 km. Finally, within ExQ1.m determine the distance between trains 1 and 2 using the equation r12(t) x1x2)2 + (V1 -V2)2 (km) Determine the minimum distance between the two trains and record it as a comment in your code. Also, determine the time when the minimum distance is achieved.
Expert Answer
Answer to I only need the third part answered. The code for the equations (ExQ1.m) is: t=0:1e-2:10; x1=5-t/2; y1=zeros(1,length(x1… . . .
OR

