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

Matlab Question. Would like detail Hws Problem 2 (15 points) The obesity of a hu

ID: 3819984 • Letter: M

Question

Matlab Question. Would like detail
Hws Problem 2 (15 points) The obesity of a human body is measured by the Body Mass Index (BM). In standard units, BMI is calculated by the formula BMI 703 W/H2 where W is weight in pounds, and His height in inches. The obesity classification is Classification BMI Below 18.5 Underweight 18.5 to 24.9 Normal Overweight 25 to 29.9 Obese 30 and above Write a MATLAB program in a script file that calculates the BMI of a person. The program 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 the 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. Use fprintf to display the text and data. The data should be displayed in f format with one decimal digit.

Explanation / Answer

weight=input('Enter your weight(in lbs): ');
height=input('Enter your height(in inches): ');
bmi=(703*weight)/(height*height);
bmi=round(bmi,1);
if(bmi<18.5)
fprintf('Your BMI value is %.1f,which classifies you as Underweight',bmi);
elseif(bmi>=18.5 && bmi <= 24.9)
fprintf('Your BMI value is %.1f,which classifies you as Normal',bmi);
elseif(bmi>=25 && bmi<= 29.9)
fprintf('Your BMI value is %.1f,which classifies you as Overweight',bmi);
else
fprintf('Your BMI value is %.1f,which classifies you as Obese',bmi);
end

Ouput:

Enter your weight(in lbs): 180
Enter your height(in inches): 74
Your BMI value is 23.1,which classifies you as Normal

Enter your weight(in lbs): 150
Enter your height(in inches): 61
Your BMI value is 28.3,which classifies you as Overweight