Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 4 ) outputs the following information to a text file named BMI . txt: The output file should contain 2 3 rows and four

(4) outputs the following information to a text file named BMI . txt:
The output file should contain 23 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.)
What to submit for this question: Please submit your script file (named a4q6.m) and the
BMI.txt file generated by your program.(16 points) You are given a text file (named HeightWeightIP.txt) that contains the
heights and weights of 50 people in the following format:
where the first number in a row is a person's height in inches and the second number is the
person's weight in pounds. The file can be downloaded at the page where you downloaded this
assignment file. Write a MATLAB script file (named a4q5.m) that
(1) reads the data in the HeightWeightIP. txt file
(2) computes the body mass index (BMI) of each person based on his/her 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:
BMI=kg(0.01cm)2
where kg is the person's weight in kilogram and cm is the person's height in
centimetres.
(3) determines the BMI category that each person belongs to by using the following
information:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago