Can someone show me how I get the answer surrounded by the phrases in quotes through using the disp and num2str functions?
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!