Cody

# Problem 1385. Perimeter

Solution 222954

Submitted on 25 Mar 2013
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   Fail
%% Test case 1: Square xy=[0,0; 1,0; 1,1; 0,1; 0,0]; err=(abs(perimeter1(xy)-4)/(4))*100; assert(err<.1)

Error: Output argument "L" (and maybe others) not assigned during call to "/users/msssystem19/perimeter1.m>perimeter1".

2   Fail
%% Test case 2 : Circle t=[0:pi/100:2*pi,0]'; xy=[cos(t),sin(t)]; err=(abs(perimeter1(xy)-2*pi)/(2*pi))*100; assert(err<.1)

Error: Output argument "L" (and maybe others) not assigned during call to "/users/msssystem19/perimeter1.m>perimeter1".

3   Fail
%% Test case 4 : Half-circle t=[0:pi/100:pi,0]'; xy=[cos(t),sin(t)]; err=(abs(perimeter1(xy)-(pi+2))/(2+pi))*100; assert(err<.1)

Error: Output argument "L" (and maybe others) not assigned during call to "/users/msssystem19/perimeter1.m>perimeter1".

4   Fail
%% Test case 4 : Hexagon side=rand; x=side*[-1 -0.5 0.5 1 0.5 -0.5 -1]; y=side*sqrt(3)*[0 -0.5 -0.5 0 0.5 0.5 0]; xy=[x',y']; err=(abs(perimeter1(xy)-(6*side))/(6*side))*100; assert(err<.1)

Error: Output argument "L" (and maybe others) not assigned during call to "/users/msssystem19/perimeter1.m>perimeter1".