MATLAB: Can someone help me with this code i want to know what every statement do

cannoncodecomments

It is a cannon game, we have a cannon of 1 unit length which aims up and down using "u" , "d" and fires a ball using "f" on another ball which appears randomly in a box with dimensions from (2,y) to (8,y). That's what we can find in the game,but.i want to know what every statement in this code do because it is not my code. Can someone download the code file in the attachments and write comments above every statement please ? 😀 Thanks in advance

Best Answer

I doubt anybody is going to be willing to spend the 20 minutes or so required to comment each statement in the code when you don't even seem to have made any effort yourself to work it out.
You have the documentation, many ways to get help on functions, and debugging tools that allow you to execute the code line by line and see what the effects are. I suggest you use these, you'll learn a lot more that way.
If after that there is a specific instruction that you don't understand, then come back here and ask about it.
Related Question