This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
xy=[0,0;
1,0;
1,1;
0,1;
0,0];
err=(abs(perimeter1(xy)-4)/(4))*100;
assert(err<.1)
L =
4
|
2 | Pass |
t=[0:pi/100:2*pi,0]';
xy=[cos(t),sin(t)];
err=(abs(perimeter1(xy)-2*pi)/(2*pi))*100;
assert(err<.1)
L =
6.2829
|
3 | Pass |
t=[0:pi/100:pi,0]';
xy=[cos(t),sin(t)];
err=(abs(perimeter1(xy)-(pi+2))/(2+pi))*100;
assert(err<.1)
L =
5.1415
|
4 | Pass |
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)
L =
4.9510
|
Create a cell array out of a struct
508 Solvers
220 Solvers
Make an awesome ramp for a tiny motorcycle stuntman
334 Solvers
middleAsColumn: Return all but first and last element as a column vector
387 Solvers
Get the length of a given vector
3562 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!