Clear Filters
Clear Filters

Can someone show me how I get the answer surrounded by the phrases in quotes through using the disp and num2str functions?

2 views (last 30 days)
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.

Answers (1)

Walter Roberson
Walter Roberson on 4 Mar 2013
Hint:
[ 'E=mc^', num2str(2) ]

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!