Question
The problem is to create a program in MATLAB in GUI or GUIDE to simulate a basketball shooting game. The question now is to edit
The problem is to create a program in MATLAB in GUI or GUIDE to simulate a basketball shooting game. The question now is to edit the code to show the parabola of the ball to determine whether it goes in or not.
I already have the following
function parabola() fprintf ('WELCOME TO THE GAME '); fprintf ('Choose distance of the basket: '); fprintf ('1. 25m 2. 40m '); distance = input('Enter 1 or 2: '); u = input('Enter the initial velocity of the basketball: '); a = input('Enter the angle at which you want to shoot: '); % calculate the range R = (u*u)*sin(2*a); R = R/9.8; if (R == distance) fprintf (' You have won!'); else fprintf (' Sorry, better luck next time.'); end end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started