Question: Roots: x 1 = 1 , x 2 = 0 . 5 Part 2 - variable size distance conversion table Write a MATLAB program or

Roots: x1=1, x2=0.5
Part 2- variable size distance conversion table
Write a MATLAB program or a MATLAB code block that can generate a conversion table to convert distance from Miles (\(\mathbf{m i}\)) to Yards (\(\mathbf{y d}\)) and to feet ( ft ).
- Ask the user to input the following information from the command window:
- The starting mile of the conversion table \({}^{[5\mathrm{pt}]}\).
- The increment between lines in miles (mi)\({}^{[5\mathrm{pt}]}\).
- The number of lines to show in the conversion table \({}^{[5\mathrm{pt}]}\).
- Generate an array of miles based on the user inputs \({}^{[5\mathrm{pt}]}\).
- Test different values and confirm your program with an online conversion calculator to ensure correctness: Conversion Calculator
- Print conversion table heading (i.e. miles, yards, feet and -----)\({}^{[5\mathrm{pt}]}\).
- Combine the miles array, the yards array, and the feet array together and print conversion table values \({}^{[5\mathrm{pt}]}\).
- Use the fprintf function to format the values in the distance conversion table to show:
-\(\mathbf{2}\) digits after the decimal point for miles \({}^{[5\mathrm{pt}]}\).
-\(\mathbf{1}\) digit after the decimal point for yards and feet \({}^{[5\mathrm{pt}]}\).
Here is an example of running the user interactive conversion table. The light blue text is generated by the Part 2 program. The numbers type in by the user are shown in purple.
Roots: x 1 = 1 , x 2 = 0 . 5 Part 2 - variable

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 Programming Questions!