MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
Asked by Brian on 4 Mar 2013

The maximum height achieved by an object thrown with a speed v at and angle of (Theta) to the horizontal, neglecting drag is

h=((v^(2))*((sin^2)*(theta))/2*g

use g=9.81m/s^2 and create a script file that lets the use enter a value of V(in m/s) and a value of theta(in degrees), and computes the maximum height h.

Use the input function twice to prompt the user to enter values for v and theta. The first prompt should say "Please enter a value of the initial velocity in m/s and then press enter". The second prompt should say "Please enter a value of the launch angle in degrees, then press enter".

Use the disp function and the num2str function to display the numerical value of the height h with the text " The maximum height is:" followed by the value of of the launch angle in degrees, followed by the text "meters." Use the script file to compute the maximum height when v=18m/s and theta=70 degrees.

I understand how to do the problem up until the point where I have to use disp and num2str functions.

*No products are associated with this question.*

## 0 Comments