Cody

Problem 44945. Calculate BMI

Solution 3289928

Submitted on 20 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
hw = [66 155;60 140;72 166;58 160;75 215]; bmi_correct = [25.0700;27.3990;22.5607;33.5100;26.9293]; assert(all(abs(bmi_calculator(hw) - bmi_correct) < 1e-4))

hw = 145.2000 155.0000 132.0000 140.0000 158.4000 166.0000 127.6000 160.0000 165.0000 215.0000 hw = 145.2000 393.7000 132.0000 355.6000 158.4000 421.6400 127.6000 406.4000 165.0000 546.1000 bmi = 1.0e+07 * 0.8300 0.6196 1.0579 0.6617 1.4868

Assertion failed.

2   Fail
hw = [10 80]; bmi_correct = 563.6375; assert(all(abs(bmi_calculator(hw) - bmi_correct) < 1e-4))

hw = 22 80 hw = 22.0000 203.2000 bmi = 9.8349e+04

Assertion failed.

Suggested Problems

More from this Author13

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!