Question: Write a function file that converts any given unit (inch, feet, cm or mm) to meters (Recall 1 in=2.54 cm and 1 ft = 12
Write a function file that converts any given unit (inch, feet, cm or mm) to meters (Recall 1 in=2.54 cm and 1 ft = 12 in). The first line of the function and example call of the function and its output is given below. Use fprintf in your function to format your outputs as in the example. function convert(x, units) Ex: For the question \"How many meters is 2 inches?\" the function should result: >> convert (2, 'in') 2 in is equal to 0.0508 m. a) Run your function to answer \"How many meters is N1 feet?\", where N1 is the last two digits of your student ID. b) Run your function to answer \"How many meters is N2 cm?\", where N1 is the last three digits of your student ID.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
