Question: For this second module you'll be writing a user - defined function in MATLAB that can perform the same unit conversions you did for module
For this second module you'll be writing a userdefined function in MATLAB that can perform the same unit conversions you did for module You'll again be using the same conversion formulae as you did for module which are given to you in Table I: Table I: Imperial to metric and viceversa conversion formulae Youve been provided with the following declaration for your function myunitconv in MATLAB Grader: function numout unit myunitconvnumin convtype This function declaration states that: There shall be Two output variables numout and unit corresponding to the converted number a doubleprecision floating point number and its new unit character array respectively. There shall also be Two input variables numin and convtype corresponding to the number you want to convert a doubleprecision floating point number and the conversiontype to apply character array respectively. All valid conversiontype char arrays along with their output unit char arrays are given in Table II: Table II: Conversiontype inputs available for unit converter program with units Write a function that will perform the appropriate unit conversion process convtype for the number that has been input by MATLAB Grader numin Ensure your function returns both the converted value numout along with the unit relating to this output number unit You must not use the MATLAB inbuilt converter functions eg unitConvert convlength convacc convvel convtemp or convmass Important Note: Do not use the keywords clear or clc in your solution.
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
