A team of engineering students is designing a catapult Boe-Bot to launch a small
ID: 3638316 • Letter: A
Question
A team of engineering students is designing a catapult Boe-Bot to launch a small ping-pong ball into a target. Write a MATLAB program that calls at least one user defined function to calculate the ball movement and plot the result in 0.01 second increment before the ball drops to the floor. Take the following user input: the height of the launcher (in), initial launch speed (ft/sec), and launch angle from horizon (degree).The following equations may be used:
vx = vx0 + ax t x = x0 + vx0t + ½ ax t2 vx2 = vx02 + 2 ax (x – x0)
vy = vy0 + ay t y = y0 + vy0t + ½ ay t2 vy2 = vy02 + 2 ay (y – y0)
For projectile motion, ax = 0, ay = -g, gravity g = 32.2 ft/sec2
The following MATLAB command may be useful:
Time = 0:0.01:t % to create an array named “Time” from 0 to t with 0.01 increment
find(z < 0) % find the location in array Z that is negative
plot (x,y), title(‘my graph’), xlabel(‘x’), ylabel(‘y’), grid % to plot array x and y
Explanation / Answer
#include #include #include void main() { clrscr(); int num1,x; coutRelated 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.