How to display y=0 in figure
조회 수: 619 (최근 30일)
추가 답변 (4개)
Image Analyst 2016년 1월 22일
Your code doesn't plot anything like those curves, but anyway, add a line specially to draw the x axis:
% Plot X axis along y=0.
line(xlim(), [0,0], 'LineWidth', 2, 'Color', 'k');
lasindu madushan 2019년 8월 11일
I want to create ball shooting game for these requirments
Can you help?
In this game, an animation should be created to display the flying trajectories of the ball shot from a fixed initial height and fixed initial velocity at release. The game player will attempt to adjust the release angle (shooting angle) of the ball to hit a board placed at the ground. Once the ball hits the board, the player will score one point. Then, the board will be randomly re-located to another position for the player to attempt another round. The specific design requirements are given below:
• Initial height of ball at release is fixed at 1.5 m. • Initial velocity of ball at release is fixed at 4 m/s. • Board length is of 0.5 m and located at height 0 horizontally. • Diameter of ball is approximately one-third of the board length. • The ball should be at rest on the board for at least 0.5 second once hit. • The board should be randomly re-located within a range reachable by the ball for each new round. • Scores should be displayed. • The player could adjust the shooting angle in command window and command the action of shooting. • The program should have a command for player to exit the program. • The program should handle exceptions such as when player enters an invalid shooting angle, etc. • The program should not crash MATLAB during running (i.e., good reliability). • You may add additional functions to your program to make it funny.
The following tasks are for students aiming for High Distinction (HD) grade of their portfolios. To get HD marks, you must ensure all the other tasks have been completed and been signed off by the tutor when submitting your final portfolio.
For High Distinction Tasks, you also need to demonstrate the programs to your tutor and answer the questions if any.
29 | P a g e
Show the screenshot of your game interface and the animation snapshots. You should add comments in your program to describe the codes allowing others to understand your code easily. You need to demonstrate the program to the tutor for sign-off.