Question: include proper comments Problem 2 (15 points): MATLAB script-2 If a stationary ball is released at a height of ho above the surface of the

Problem 2 (15 points): MATLAB script-2 If a stationary ball is released at a height of ho above the surface of the Earth with a vertical velocity Vo, the position and velocity of the ball as a function of time will be given by the equations: 1 h(t) = 1 g+++V+++ ho v(t) = got+V where g is the acceleration due to gravity (-9.81 m/s), h is the height above the surface of the Earth, and V is the vertical component of velocity. Write a m file (script file) that prompts a user for the initial height of the ball in meters and velocity of the ball in meters per second, and plots the height and velocity as a function of time. Create each plot in a separate figure with time values varying from 0 to 30 seconds with a minimum of 200 values. Be sure to include proper labels and titles. Problem 4 (15 points): MATLAB script-4 The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.85 for the next 200 miles, and $0.65 for all miles in excess of 300 miles. Write a .m file that determines the total cost and the average cost per mile for a given number of miles (stored in a variable distance). Use the following fprintf statement as an output: "For a total distance of XX.X miles, the total cost is $XXX.XX and the average cost per mile is $X.XX." Sample Input/Output Enter the total miles traveled: 515 For a total distance of 515.0 miles, the total cost is $409.75 and the average cost per mile is $0.80. Problem 6 (20 points): MATLAB script-6 Create a m file (script file) that will evaluate the given function f(x,y) (Note: This is not a function as MATLAB considers one, yet a mathematical function.) for any two user specified values x and y. The function is defined as follows: (x+y x > 0 and y20 x + y2 x 0 and y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
