Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a MATLAB question. Will give thumbs up for correct answers. III. Implement your Procedure Now that you've planned out a procedure, it is
This is a MATLAB question. Will give thumbs up for correct answers.
III. Implement your Procedure Now that you've planned out a procedure, it is time to implement it. Create a new MATLAB script and include the following information at the top: % Your Name % Today's Date % Lab 3: Input and Output Statements in MATLAB clear;home:close all Once you have this header set up, write MATLAB code to implement the procedure you've defined. As a reminder, there are two main input statements in MATLAB Input statement var input ('Message') Menu statement var-menu 'Message','Option 1','Option 2",...); Use input statements to ask the user for exit velocity and firing angle in degrees. Convert the firing angle to radians. YOU MUST USE RADIANS IN ALL CALCULATIONS! Use a menu statement to determine which planet to use. Remember the return from a menu statement is a number. Define a vector of gravity values in the same order as your planets. Use the planet number and the vector of gravities to determine the proper value of gravity to use for your problem. planet = a value from 1 to 9 from the menu statement g = [3.59 8.87 9.81 3.77 25.95 11.08 10.67 14.07 0.42]; planet-g = g (planet); In addition, there is one main output statements in MATLAB fprintf statement fprintf ('Formatted Message',vars) i You must use fprintf statement(s) to print to the screen the values of time to impact, maximum height and total distance III. Implement your Procedure Now that you've planned out a procedure, it is time to implement it. Create a new MATLAB script and include the following information at the top: % Your Name % Today's Date % Lab 3: Input and Output Statements in MATLAB clear;home:close all Once you have this header set up, write MATLAB code to implement the procedure you've defined. As a reminder, there are two main input statements in MATLAB Input statement var input ('Message') Menu statement var-menu 'Message','Option 1','Option 2",...); Use input statements to ask the user for exit velocity and firing angle in degrees. Convert the firing angle to radians. YOU MUST USE RADIANS IN ALL CALCULATIONS! Use a menu statement to determine which planet to use. Remember the return from a menu statement is a number. Define a vector of gravity values in the same order as your planets. Use the planet number and the vector of gravities to determine the proper value of gravity to use for your problem. planet = a value from 1 to 9 from the menu statement g = [3.59 8.87 9.81 3.77 25.95 11.08 10.67 14.07 0.42]; planet-g = g (planet); In addition, there is one main output statements in MATLAB fprintf statement fprintf ('Formatted Message',vars) i You must use fprintf statement(s) to print to the screen the values of time to impact, maximum height and total distance Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started