Question: 2. (a) (15 marks) A stone is an imperial unit of mass. Create in MATLAB a function (a single file containing this function) that converts
2. (a) (15 marks) A stone is an imperial unit of mass. Create in MATLAB a function (a single file containing this function) that converts kg to stone. The function input argument should be an amount in kg, and the output argument should be the same amount but now in stone. Note that 1 stone equals 6.35029 kg. (b) (10 marks) Modify the function, so that the function returns two numbers: the integer amount (rounded down) in stone and the remaining amount in pounds. Note that there are 14 pounds in one stone. Hence 2.5 stone would become 2 stone and 7 pounds. (c) (5 marks) Create a test script that calls the previous function and tests it for known values. of the expected results are not returned, an error message shoqld be displayed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
