Question: MATLAB 1. (20 points) Write a script A3_HW2_1.m which converts 250 miles to km 2. (20 points) Write an external function KmToMiles.m for km-to-miles conversion,

MATLAB

MATLAB 1. (20 points) Write a script A3_HW2_1.m which converts 250 miles

1. (20 points) Write a script A3_HW2_1.m which converts 250 miles to km 2. (20 points) Write an external function KmToMiles.m" for km-to-miles conversion, which takes an input argument in km and outputs a value in miles 3. (30 points) Write a script "A3_HW2_2.m", which prompts the user to enter a value in km (e.g., 500 km) using the input function, calculates distance in miles using your external function KmToMiles.m, and prints the distance in miles using the disp function 4. (30 points) Write a script "A3_HW2_3.m", which assigns a variable representing a distance a value of 650 km, converts the distance to miles using a custom local function "Miles TokmLocal.m", and calculates the cost of trip assuming a gasoline consumption rate of 28 miles per gallon and a gasoline cost of $1.85/gallon. Your script should print out the distance in miles and the trip cost with 2 digits after the decimal point using the fprintf function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!