Cody

Problem 45373. Hanging cable - 01

Solution 2965477

Submitted on 18 Sep 2020 by Alfonso Nieto-Castanon
  • Size: 38
  • 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
assert(abs(cable_01(50,120)-52.7537)<0.0001)

2   Pass
assert(abs(cable_01(50,200)-164.7918)<0.0001)

3   Pass
assert(isequal(cable_01(50,100),0))

4   Pass
assert(abs(cable_01(80,180)- 60.2058)<0.0001)

5   Pass
assert(abs(cable_01(100,180)-55.9443)<0.0001)

6   Pass
assert(abs(cable_01(100,199)-5.9740)<0.0001)

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!