Given weight in kgs and height in metres, calculate body mass index
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers37
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53696 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
560 Solvers
-
Area of an equilateral triangle
7008 Solvers
-
Matlab Basics - y as a function of x
532 Solvers
-
124 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
A few more test cases would be nice.
Most of the solutions seem to complicate the calculation to artificially compensate for the fact that the test problem result is in error by 0.01.
Re: the value in the single test case, it's possible that you're supposed to truncate at two decimal digits as well. Which actually makes me wish MATLAB had something like floor(x, 2) and ceil(x, 2), akin to round(x, 2).