MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
6th Edition
ISBN: 9781119256830
Author: Amos Gilat
Publisher: John Wiley & Sons Inc
bartleby

Concept explainers

bartleby

Videos

Question
100%
Book Icon
Chapter 4, Problem 1P
To determine

The Body Mass index by taking the variables as input from user.

Expert Solution & Answer
Check Mark

Answer to Problem 1P

Solution:

The Body Mass index is 24.6.

Explanation of Solution

Given Information:

  • The mass of the person is 162lb.
  • The height of the person is 68in.
  • The BMI is calculated as BMI=703Wh2.

Formula to calculate the BMI is

    BMI=703Wh2

Where,

  • BMI is the Body Mass index.
  • W is the weight of person in lb.
  • h is the height of person in in.

Substitute 162lb for W and 68in for h to find BMI.

    BMI=703( 162lb) ( 68in )2=24.629324.6

Write the MATLAB script that calculates the Body Mass index by taking the variables as input from user.

MATLAB Code:

W = input('Enter the weight: ');

% Provide input to the variable W.

h = input('Enter the height: ');

% Provide input to the variable h.

BMI = round((703*W)/(h^2),1);

% Calculate the BMI.

fprintf('The BMI is: %f\n', BMI);

% Print the result.

Save the MATLAB script with name, Chapter1_56830_4_1P.m in the current folder. Execute the script by typing the script name at the command window to calculate the Body Mass index by taking the variables as input from user.

Result:

MATLAB: An Introduction with Applications, Chapter 4, Problem 1P

Conclusion:

Therefore, the Body Mass index is 24.6.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!

Chapter 4 Solutions

MATLAB: An Introduction with Applications

Knowledge Booster
Background pattern image
Statistics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
MATLAB: An Introduction with Applications
Statistics
ISBN:9781119256830
Author:Amos Gilat
Publisher:John Wiley & Sons Inc
Text book image
Probability and Statistics for Engineering and th...
Statistics
ISBN:9781305251809
Author:Jay L. Devore
Publisher:Cengage Learning
Text book image
Statistics for The Behavioral Sciences (MindTap C...
Statistics
ISBN:9781305504912
Author:Frederick J Gravetter, Larry B. Wallnau
Publisher:Cengage Learning
Text book image
Elementary Statistics: Picturing the World (7th E...
Statistics
ISBN:9780134683416
Author:Ron Larson, Betsy Farber
Publisher:PEARSON
Text book image
The Basic Practice of Statistics
Statistics
ISBN:9781319042578
Author:David S. Moore, William I. Notz, Michael A. Fligner
Publisher:W. H. Freeman
Text book image
Introduction to the Practice of Statistics
Statistics
ISBN:9781319013387
Author:David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:W. H. Freeman
Matrix Operations Full Length; Author: ProfRobBob;https://www.youtube.com/watch?v=K5BLNZw7UeU;License: Standard YouTube License, CC-BY
Intro to Matrices; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=yRwQ7A6jVLk;License: Standard YouTube License, CC-BY