Cody

Problem 417. Covering area

Solution 2234587

Submitted on 25 Apr 2020 by Yaroslav Br
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 = [1 1; 1 -1; -1 1; -1 -1; 0 0]; y_correct = 4; assert(isequal(cover_area(x),y_correct))

x = 1 1 -1 -1 0 y = 1 -1 1 -1 0 ans = 4

2   Pass
x = [1 1; 1 -2; -2 1; -1 -2; 2 -1; -3 0; 0.2*randn(4,2)]; y_correct = 11; assert(isequal(cover_area(x),y_correct))

x = 1.0000 1.0000 -2.0000 -1.0000 2.0000 -3.0000 0.1105 0.0892 0.1648 0.1136 y = 1.0000 -2.0000 1.0000 -2.0000 -1.0000 0 0.0065 0.1574 -0.0996 0.0328 ans = 11

3   Pass
x = [1 1; 1 -2; -1 1; -1 -2; 3 4; 0.2*randn(10,2)]; y_correct = 12; assert(isequal(cover_area(x),y_correct))

x = 1.0000 1.0000 -1.0000 -1.0000 3.0000 -0.0907 0.0794 -0.2677 0.1835 0.3458 0.2866 -0.0558 -0.1791 -0.2764 -0.2542 y = 1.0000 -2.0000 1.0000 -2.0000 4.0000 -0.0253 0.1227 -0.5019 -0.1904 0.1130 0.2381 0.4102 -0.0850 -0.1373 0.1513 ans = 12

Suggested Problems

More from this Author3

Community Treasure Hunt

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

Start Hunting!