Use Matlab h(t) = -1/2 gt^2 + (v sin theta)t + h_0 where t is the time in second
ID: 3862845 • Letter: U
Question
Use Matlab h(t) = -1/2 gt^2 + (v sin theta)t + h_0 where t is the time in second, where h. is the initial height (1 m) and g is the acceleration due to gravity (9.81 m/s^2). V is our initial velocity (10 m/s) and theta is the initial angle. First, create a function with the height as the output and with time, velocity, and angle as inputs. Next, use your function using fplot and subplot make one plot with 4 subplots, letting theta equal 30, 45, 60, and 70. Let t go from 0 seconds to 2 seconds for each plot. Make sure to label each plot and all axes. Include your code and plot below. Skills -writing functions .fplot, subplot, good graphing practicesExplanation / Answer
Here is the code for you:
fplot(@(time) -1/2*9.81*time*time + 10 * sin(30) * time + 1, [0: 0.1: 2]);
subplot(2, 2, 1);
fplot(@(time) -1/2*9.81*time*time + 10 * sin(45) * time + 1, [0: 0.1: 2]);
subplot(2, 2, 2);
fplot(@(time) -1/2*9.81*time*time + 10 * sin(60) * time + 1, [0: 0.1: 2]);
subplot(2, 2, 3);
fplot(@(time) -1/2*9.81*time*time + 10 * sin(70) * time + 1, [0: 0.1: 2]);
subplot(2, 2, 4);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.