Question: use Matlab, please Write a program (a script and a local function) that converts the height and weight of a person from SI units to

use Matlab, please use Matlab, please Write a program (a script and a local function)

Write a program (a script and a local function) that converts the height and weight of a person from SI units to US customary units. The script ConvertUnits.m: prompts the user to enter her height in centimeters; and her weight in kilograms. If the height or weight is not valid (negative or not a number), the script displays an error message and ends the program, If the entered values are valid, it calls the local function Convertiso_to_US to convert the height to inches and the weight to pounds. After receiving the height and weight values from the function, prints a message such as: "Your height is 78 in and you weight is 150lb." h The local function Convertiso_to_US.m: . Receives two input arguments: height in cm and weight in kg converts the height to inch using the relation: 1 inch = 2.54 cm converts the weight to lb using the relation: 1kg = 2.2 lb 'returns the height in inch and weight in lb

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!