Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Write a function bmiCalc() that takes two inputs; a filename with personal data (char array), and the name of a person of interest (a

image text in transcribed

2. Write a function bmiCalc() that takes two inputs; a filename with personal data (char array), and the name of a person of interest (a string). The function will return the BMI of the person of interest. The data file is provided on Moodle. First read the data from the file using readcell() Use a for loop and a built in function (check reference sheet) to compare the name of the person of interest to the names provided in the data file and extract the mass and height of ONLY the person of interest. The height is the second column, the mass is the third. Be careful when using {} or () to index. There is a difference. Calculate BMI = mass (kg) / height(in)? Return the calculated BMI The function header and an example run are provided below. function [bmi] = bmicalc(filename, personName) Using the data provided in filename, returns the BMI of the user whose string name is the string personName Inputs: filename - character array of the personal data file personName - name of the person whose BMI is to be calculated Returns: bmi - bmi found by mass/ height^2 Command Window >> BMI_Jack = bmiCalc('BMI_Data.xlsx', "Jack") BMI_Jack = 20.518 fx >>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Postgresql 16 Administration Cookbook Solve Real World Database Administration Challenges With 180+ Practical Recipes And Best Practices

Authors: Gianni Ciolli ,Boriss Mejias ,Jimmy Angelakos ,Vibhor Kumar ,Simon Riggs

1st Edition

1835460585, 978-1835460580

More Books

Students also viewed these Databases questions

Question

(6) If E(X) = 1 and E(X2) = 2, then the variance is 2.

Answered: 1 week ago