0% found this document useful (0 votes)
13 views

PPS Mini Project

Uploaded by

ashutosh.nirmals
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

PPS Mini Project

Uploaded by

ashutosh.nirmals
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Problem Statement: Health Calculator for BMI (Body Mass Index)

The Body Mass Index (BMI) is a measure that helps determine whether a person has a healthy body
weight for a given height. It is an essential health indicator and is widely used by healthcare
professionals to evaluate an individual's weight status (underweight, normal weight, overweight, or
obese). This Health Calculator will compute the BMI and categorize it into different health ranges
based on standard BMI values. The system will also visualize the results in graphical and tabular
formats to enhance understanding.

1. Problem Statement

The problem at hand is to design a MATLAB program that calculates a person's BMI based on their
height and weight and then categorizes the result into one of the following categories:

 Underweight: BMI < 18.5

 Normal weight: 18.5 ≤ BMI < 24.9

 Overweight: 25 ≤ BMI < 29.9

 Obesity: BMI ≥ 30

The program should allow the user to input their height (in meters) and weight (in kilograms),
calculate the BMI, and display the result in both text and graphical forms. Additionally, a table
showing the BMI categories will be displayed.

2. Input and Output Parameters

Input:

 Height of the individual (in meters)

 Weight of the individual (in kilograms)

Output:

 Calculated BMI value

 BMI category (underweight, normal weight, overweight, or obese)

 Graphical representation of the BMI category

 A table showing BMI categories and their respective ranges

3. List of Built-in Functions Used

 input: Used to take user input for height and weight.

 disp: Used to display results in textual form.

 plot: Used to generate a graphical representation of BMI ranges.

 table: Used to display BMI categories in a tabular form.

 xlabel, ylabel: Used to label axes in the graph.

 title: Used to add a title to the graph.

 axis: Used to set axis limits for the graph.


4. Algorithm

1. Input the height and weight from the user.

2. Calculate the BMI using the formula: BMI=weightheight2BMI = \frac{weight}


{height^2}BMI=height2weight

3. Categorize the BMI based on standard BMI ranges:

o BMI < 18.5 → "Underweight"

o 18.5 ≤ BMI < 24.9 → "Normal weight"

o 25 ≤ BMI < 29.9 → "Overweight"

o BMI ≥ 30 → "Obesity"

4. Display the BMI value and its category.

5. Display the BMI categories in a tabular format.

6. Plot a graphical representation of the BMI categories.

7. Show the graph with labels and title.

5. Code

matlab

Copy code

% BMI Health Calculator

% Step 1: User Input for Height and Weight

height = input('Enter your height in meters: ');

weight = input('Enter your weight in kilograms: ');

% Step 2: Calculate BMI

BMI = weight / (height^2);

% Step 3: Categorize BMI

if BMI < 18.5

category = 'Underweight';

elseif BMI >= 18.5 && BMI < 24.9

category = 'Normal weight';

elseif BMI >= 25 && BMI < 29.9


category = 'Overweight';

else

category = 'Obesity';

end

% Step 4: Display BMI and Category

fprintf('Your BMI is: %.2f\n', BMI);

fprintf('You are classified as: %s\n', category);

% Step 5: Create a Table for BMI Categories

bmi_table = table([18.5; 24.9; 29.9; 30], ...

{'Underweight'; 'Normal weight'; 'Overweight'; 'Obesity'}, ...

'VariableNames', {'BMI_Range', 'Category'});

disp('BMI Categories:');

disp(bmi_table);

% Step 6: Plot a Graphical Representation of BMI Categories

figure;

categories = {'Underweight', 'Normal weight', 'Overweight', 'Obesity'};

bmi_values = [18.5, 24.9, 29.9, 30];

colors = ['b', 'g', 'y', 'r']; % Color coding for each category

bar(bmi_values, 'FaceColor', 'flat');

set(gca, 'XTickLabel', categories);

title('BMI Categories');

xlabel('Category');

ylabel('BMI Range');

ylim([0 35]);

% Step 7: Display Graph


grid on;

6. Output

Sample Output:

yaml

Copy code

Enter your height in meters: 1.75

Enter your weight in kilograms: 70

Your BMI is: 22.86

You are classified as: Normal weight

BMI Categories:

BMI_Range Category

__________ ______________

18.5 Underweight

24.9 Normal weight

29.9 Overweight

30 Obesity

(Bar chart displayed showing the BMI ranges and categories)

7. Conclusion

The MATLAB Health Calculator successfully calculates the BMI based on the height and weight inputs
and classifies the result into one of the four health categories. The program provides both textual
and graphical output for better understanding and visualization of BMI categories. The table clearly
displays the BMI ranges for each health category, while the bar chart provides a visual
representation. This tool can be helpful for individuals to monitor their health status and take
necessary actions to maintain a healthy weight.

8. References

 World Health Organization (WHO), "BMI Classification". WHO BMI Guidelines

 MATLAB Documentation: MathWorks Documentation

9. Details of Contribution from Each Member of the Group

 Member 1: Developed the algorithm for BMI calculation and categorization.

 Member 2: Implemented the code, including the input/output handling and table creation.
 Member 3: Designed the graphical representation and contributed to styling and labels in
the chart.

 Member 4: Verified the output and performed testing to ensure accuracy of the program

You might also like