Cody

Problem 45379. 3rd side of a Triangle

Solution 2172854

Submitted on 24 Mar 2020 by Payam Morsali
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
[mx,mn]=tri_side(20,10); assert(abs(mx-52.2727)<.001) assert(abs(mn- 31.9756)<.001)

mi = 11 ma = 29 p1 = 20.5000 p2 = 29.5000 min = 31.9756 max = 52.2727

2   Pass
[mx,mn]=tri_side(50,50); assert(abs(mx-349.1417)<.001) assert(abs(mn-24.9987)<.001)

mi = 1 ma = 99 p1 = 50.5000 p2 = 99.5000 min = 24.9987 max = 349.1417

3   Pass
[mx,mn]=tri_side(1,3); assert(abs(mx-1.479)<.001) assert(abs(mn- 1.479)<.001)

mi = 3 ma = 3 p1 = 3.5000 p2 = 3.5000 min = 1.4790 max = 1.4790

4   Pass
[mx,mn]=tri_side(1000,30); assert(abs(mx-3895.8352)<.001) assert(abs(mn-3784.4461)<.001)

mi = 971 ma = 1029 p1 = 1.0005e+03 p2 = 1.0295e+03 min = 3.7844e+03 max = 3.8958e+03

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!