Problem 44945. Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas:
- 1 kilogram = 2.2 pounds
- 1 inch = 2.54 centimeters
- BMI = weight(kg) / [height(m)]^2
The first column is the height in inches. The second column is the weight in pounds.
Solution Stats
Problem Comments
-
19 Comments
Show
16 older comments
Christian Schröder
on 9 Aug 2024
@Prathamesh Using your code, bmi is returned as a row vector, but the test suite expects a column vector.
Juan
on 16 Nov 2024
In this excercise the big deal is to recognice that the solution must be in the same format as the entry data. That in this case is a Column Vector.
Robert
on 29 May 2025
The conversions are confusing. The formula requires kilograms and meters. To calculate, the conversion matrix used for the dot product must be:
[.0254 1/2.2]
Solution Comments
Show commentsProblem Recent Solvers9991
Suggested Problems
-
15979 Solvers
-
First non-zero element in each column
895 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
645 Solvers
-
654 Solvers
-
979 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!