Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are given a text file ( named HeightWeightIP.txt ) that contains the heights and weights of 5 0 people in the following format: 5
You are given a text file named HeightWeightIP.txt that contains the
heights and weights of people in the following format:
:: ::
where the first number in a row is a persons height in inches and the second number is the persons weight in pounds. The file can be downloaded at the page where you downloaded this assignment file. Write a MATLAB script file named aqm that
reads the data in the HeightWeightIP.txt file
computes the body mass index BMI of each person based on hisher height and
weight. For this step, your program should call the IPtoCK function that you wrote for the last question to convert the height in inches and weight in pounds to the corresponding centimetres and kilograms. After the conversion, your program should calculate the BMI value of the person using the following formula:
times
where kg is the persons weight in kilogram and cm is the persons height in
centimetres.
determines the BMI category that each person belongs to by using the following
information:
BMI category
underweight normal overweight obese
BMI range
outputs the following information to a text file named BMI.txt: Heightcm Weightkg BMI Category
normal
normal
normal
overweight
normal
normal
:::: ::::
The output file should contain rows and four columns. The first row is the heading. Each row after that describes the height in centimetres weight in kilograms the BMI value, and the BMI category of the person in the corresponding row of the input file. Hint: you can create such a file with fprintf and a loop statement.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started