Answer the code using MATLAB. In standard units it is cal. 28. Body mas index (B
ID: 2291894 • Letter: A
Question
Answer the code using MATLAB.
In standard units it is cal. 28. Body mas index (BMD is a measure of obesity. culated by the formula BMI = 703 where W'is weight in pounds, and H is height in inches. The obesity classif. cation is: BMI Below 18.5 18.5 to 24.9 25 to 29.9 30 and above Classification Underweight Normal Overweight Obese Write a program in a script file that calculates the BMI of a person. The pro- gram asks the person to enter his or her weight (lb) and height (in.). The program displays the result in a sentence that reads: "Your BMI value is XXX, which classifies you as SSSS," where XXX is the BMI value rounded to the nearest tenth, and SSSS is the corresponding classification. Use th program for determining the obesity of the following two individuals: (a) A person 6 ft 2 in. tall with a weight of 180 lb. (b) A person 5 ft 1 in. tall with a weight of 150 lb.Explanation / Answer
w = input('Enter weight (lb)');
h = input('Enter height (in)');
BMI = 703*w/(h*h);
if BMI<18.5
clsfi = 'Underweight';
elseif BMI>18.5 && BMI<24.9
clsfi = 'Normal';
elseif BMI>25 && BMI<29.9
clsfi = 'Overweight';
elseif BMI>30
clsfi = 'Obese';
end
BMI = round(BMI,10);
fprintf('Your BMI value is %d, which classifies you as %s ',BMI,clsfi);
command window output: