Problem 49062. Mass Conversion 2
Given a mass in lbs, convert it into kg. Use a conversion factor of 2.205 lbs/kg.
Solution Stats
Problem Comments
-
9 Comments
Show
6 older comments
Michael Jarboe
on 15 Jul 2022
% my solution - print out y value to compare against y_correct
y = x / 2.205;
disp(['y = ' num2str(y)])
disp(y)
% Test 2 and 3 Fail....
x = 50;
y_correct = 22.6757;
assert(isequal(convert_stuff(x),y_correct)) % Assertion failed.
Output:
y = 22.6757 % NOT SURE WHY THIS FAILS????
22.6757
%% Does not look like a precision issue
Ethan
on 17 Jul 2023
Big +1 to all the comments saying that the answers need to be rounded to 4 decimal places. Please put this in the description
Khoi Nguyen
on 20 Sep 2023
hint: round to the 4th decimal
Solution Comments
Show commentsProblem Recent Solvers783
Suggested Problems
-
Back to basics 22 - Rotate a matrix
910 Solvers
-
8985 Solvers
-
651 Solvers
-
990 Solvers
-
983 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!