Fitness Tracker with MATLAB 

 September 18, 2019

By  Ceethal Piyus


As per the records of WHO the prevalence of obesity in the world has risen to epidemic proportions. This isn’t just limited to one part of the world. Nations everywhere have obese citizens. While some think that the richest and the most developed countries in the world are the most obese, this isn’t always the case. In fact, the United States and the United Kingdom are two of the most economically rich and developed countries in the world. However, they are only ranked 12th and 36th, respectively, when compared to other nations. There have been multiple nations with small economies that have been classified as the most obese, and as per the World Health Organization. The number of obese people in the world total is approximately 2.1 billion, which makes up about 30% of the total population. This number continues to rise. Over 3 million people each year die from obesity.

In addition to dramatically decreasing a person’s lifespan, the quality of life of an obese person is affected. This is of major concern as excess fat distribution is strongly associated with different health risk conditions including higher risks of diabetes, heart disease and even certain types of cancer. Other health risks from obesity include osteoarthritis, kidney disease, strokes, and high blood pressure. Hence, a simple and effective measure of obesity is needed for risk assessment in order to guide appropriate management and develop preventive strategies.

Many people want to know the answer to this question: What should I eat? and How much should I weigh? we will be answering the second question through this blog, because the question of what you should eat is highly individualized. So let’s get into answering how much you should weight? However, there is not one ideal healthy weight for each person, because a number of different factors play a role. These include age, muscle-fat ratio, height, gender, and body fat distribution, or body shape.

So the motivation behind developing this application is to track the overall fitness as well as a healthy weight of a person by considering different obesity parameters such as Body Mass Index (BMI), Waist-Hip Ratio (WHR) and Waist-Height Ratio (WHtR). Combining all these three parameters is one of the best ways to get an accurate idea of whether or not you should consider changing your diet or exercise routine. This blog will demonstrate how BMI, WHR, and WHtR are calculated using different body parameters in MATLAB and how their score will impact your health and early prediction of obesity. This Fitness Tracker application is very helpful for anyone who is looking to make strides in their fitness. 

Now let's have an understanding of each parameter and how they are going to predict the health status of a person.

Body Mass Index (BMI)

Waist to Hip Ratio (WHR)

Waist to Height Ratio (WHtR)

Why BMI WHR and WHtR are selected over other parameters?

Prerequisites required

  • MATLAB Version above MATLAB R2016a
  • MATLAB App designer

Graphical User Interface

Six panels are used to create the complete look of this application. Once the app starts running, the user first sees the input / user panel. After clicking the "Show My Results" button, the app will take you to the next panel, the result panel. From the result panel, the user can view the score analysis of the BMI, WHR and WHtR, and the caution panel will provide an overview of various preventive measures. The entire graphical user interface was created using MATLAB App Designer, and the webinar video below explains how to create it.

Graphical user interface was created using MATLAB App Designer

Fig 4: Graphical user interface was created using MATLAB App Designer

Algorithm Design

Once the application panel is ready, the next step is to write the code to determine the behavior for the components, the following image shows the overall workflow of the application design.

Overall workflow of the application design

Fig 5: Overall workflow of the application design

so in the first stage, data acquisition, we will be collecting the different body parameters including gender, height , weight, waist circumference and hip circumference from the user side as an input to our application. These parameters are then used to calculate the BMI, WHR and WHtR. In the output stage there will be health risk level prediction with respect to your score and gender. There will be a individual score analysis as well as a general conclusion out of it, moreover this application will also give an idea about the precautions to be followed in order to maintain  healthy lifestyle.

Once the input parameters are obtained, the model will predict your health by following three steps: unit conversion, BMI, WHR, WHtR calculation, and finally risk level classification based on BMI, WHR and WHtR scores. In the coming sections, we will see the algorithms that were followed to perform these steps.

Overall algorithm design

Fig 6 : Overall algorithm design

Unit Conversion

BMI, WHR and WHtR calculation

Risk level classification based on BMI, WHR and WHtR scores


Following are the results obtained by entering different body parameters of different people in the application.

Case 1: Person with Central Obesity or Belly Fat

Case 2: Highly Overweight Person with Central Obesity

Case 3: Healthy  Person with More Muscle Mass

Case 4: Underweight Person

The application accurately predicted overall health status in all four different cases


This fitness tracker intended to be the simple and straightforward application so that everyone can get the most out of it, whether they’re a beginner or a fitness pro. This application gives you a complete picture of your health than providing a general overview which might not be entirely accurate. It also overcomes the drawbacks of using BMI alone to predict health risk. It is also worth noting that the app has been able to accurately predict the health status of different people with different body parameters.

Learning about your BMI, WHR and WHtR rate is a positive step in the process of reaching or maintaining a healthy weight. The more you know, the easier it is to make changes in your life that produce real results. Track your BMI, WHR and WHtR scores, keep a weight loss or weight gain journal, gather support from friends and family, and connect with your healthcare team to find a plan that works over the long-term for you.



Watch the video below for the full code and try to replicate all the results yourself !

Get Standalone Application of Webinar

This Standalone has been created using MATLAB R2018b. Get the application running and start evaluating your fitness.

Standalone Application Installation Steps

Get instant access to the code, model, or application of the video or article you found helpful! Simply purchase the specific title, if available, and receive the download link right away! #MATLABHelper #CodeMadeEasy

Ready to take your MATLAB skills to the next level? Look no further! At MATLAB Helper, we've got you covered. From free community support to expert help and training, we've got all the resources you need to become a pro in no time. If you have any questions or queries, don't hesitate to reach out to us. Simply post a comment below or send us an email at [email protected].

And don't forget to connect with us on LinkedIn, Facebook, and Subscribe to our YouTube Channel! We're always sharing helpful tips and updates, so you can stay up-to-date on everything related to MATLAB. Plus, if you spot any bugs or errors on our website, just let us know and we'll make sure to fix it ASAP.

Ready to get started? Book your expert help with Research Assistance plan today and get personalized assistance tailored to your needs. Or, if you're looking for more comprehensive training, join one of our training modules and get hands-on experience with the latest techniques and technologies. The choice is yours – start learning and growing with MATLAB Helper today!

Education is our future. MATLAB is our feature. Happy MATLABing!

About the author 

Ceethal Piyus

  • ananya gupta says:

    Hello, Nice content shared by you its really good and useful for me from which i understand concept very clear about Matlab.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    MATLAB Helper ®

    Follow: YouTube Channel, LinkedIn Company, Facebook Page, Instagram Page

    Join Community of MATLAB Enthusiasts: Facebook Group, Telegram, LinkedIn Group

    Use Website Chat or WhatsApp at +91-8104622179