Problem 57978. Calculate BMI
Given weight in kgs and height in metres, calculate body mass index
Solution Stats
Problem Comments
-
3 Comments
Christian Schröder
on 14 Apr 2023
A few more test cases would be nice.
William
on 14 Apr 2023
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.
Christian Schröder
on 15 Apr 2023
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).
Solution Comments
Show commentsProblem Recent Solvers31
Suggested Problems
-
Select every other element of a vector
35897 Solvers
-
1219 Solvers
-
Output any real number that is neither positive nor negative
407 Solvers
-
Replace 0 indices in array with 1's
140 Solvers
-
2687 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!