Cody

Solution 1857193

Submitted on 25 Jun 2019 at 7:48 by Daniel Yago
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 = [0 0 1]; y = [0 1 0]; x_centroid = 0.33333; y_centroid = 0.33333; [x_t,y_t]=Centroid(x,y); assert(abs(x_t-x_centroid)<10^(-4)&&abs(y_t-y_centroid)<10^(-4))

2   Pass
x= [-2 3 1] y= [-2 -1 3] y_centroid = 0 x_centroid = 0.66667; [x_t,y_t]=Centroid(x,y); assert(abs(x_t-x_centroid)<10^(-4)&&abs(y_t-y_centroid)<10^(-4))

x = -2 3 1 y = -2 -1 3 y_centroid = 0

Suggested Problems