The obesity of a human body is measured by the Body Mass Index (BMI). In standar
ID: 3834014 • Letter: T
Question
The obesity of a human body is measured by the Body Mass Index (BMI). In standard units, BMI is calculated by the formula BMI = 703 W/H^2 where W is weight in pounds, and H is height in inches. The obesity classification is 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 person 6 ft 2 in. tall with a weight of 180 lb. 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 pound format with one decimal digit.Explanation / Answer
Weight = input('Enter your weight (lbs)');
Height = input('Enter your height (ft):');
BMI = (703 * Weight / (Height * Height))
if (BMI < 18.5);
disp('underweight')
elseif ((BMI >= 18.5) && (BMI <= 24.9));
disp('Normal')
elseif ((BMI >= 25) && (BMI <= 29.9));
disp('Overweight')
elseif (BMI >= 30);
disp('Obese')
end
output 1 Obese
output 2 Obese