Need some help with the following MATLAB question: MATLAB Program Problem FA roc
ID: 2073596 • Letter: N
Question
Need some help with the following MATLAB question:
MATLAB Program Problem FA rocket is vertically propelled up during the first 1.5 secs with a speed of v(t) = (a-g) * t and then falling down with a speed of u (t) =-g * t for the following 2.5 secs. Using "for-end" statement with an inner loop of "if-else-end" statement, compute v (t) during 4 secs with an increment of 0.1 secs. Plot v (t) vs. t during 4 secs (i.e. t-0:0.1:4.0). Add the labels of axes and the tile of plot. Use lines with symbols to represent a curve.Explanation / Answer
g=9.81;
x0=0;
y0=0;
x=t;
y=v(t);
for t=0:0.1:4;
if t<=1.5
v(t)=(a-g)*t;
else
1.5<t<=4
v(t)=-g*t;
end
end
figure;
plot(v,t);
title('v(t) vs t');
xlable('time(s)');
ylable('velocity');
grid on;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.