Problem 44292. Archimedes principle

Solution 1258970

Submitted on 29 Aug 2017 by yurenchu
  • Size: 8
  • This is the leading solution.
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   Pass
x = 1020; h_correct = 0.3; tolerance = 1e-4; assert(abs(height(x)-h_correct)<tolerance)

2   Pass
x = 1000; h_correct = 0.3; tolerance = 1e-2; assert(abs(height(x)-h_correct)<tolerance)

Suggested Problems

Community Treasure Hunt

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

Start Hunting!