Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an m-file function per the following description Write a user-defined MATL

ID: 2996807 • Letter: W

Question

Write an m-file function per the following description

Write a user-defined MATLAB function, with two input and two output arguments. that determines the height in centimeters and mass m kilograms of a person from his height in inches and weight m pounds. For the function name and arguments use [cm, kg] = STtoSI (in, lb). The input arguments are the height in inches and weight in pounds, and the output arguments are the height m centimeters and mass in kilograms. Use the function m the Command Window to: Determine in SI units the height and mass of a 5 ft 8 in. person who weighs 175 lb. Determine your own height and weight m SI units.

Explanation / Answer

function [kg,cm]= convert1(lbs,in)
disp('weight in kg is :')
kg=0.453592*lbs
disp('height in centimeters is :')
cm=2.54*in

copy this program and save with name convert1

sample output:

weight in kg is :

kg =

36.2874

height in centimeters is :

cm =

142.2400


ans =

36.2874

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote