Cody

Solution 1939674

Submitted on 17 Sep 2019 at 13:13
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
assert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));

l = 0.0175

Index exceeds the number of array elements (1). Error in sphere_distance (line 63) d = greatCircleDistance(p1*l, l(90-a1), l*p2, l*(90-a2), r) Error in Test1 (line 1) assert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));

2   Fail
assert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));

l = 0.0175

Array indices must be positive integers or logical values. Error in sphere_distance (line 63) d = greatCircleDistance(p1*l, l(90-a1), l*p2, l*(90-a2), r) Error in Test2 (line 1) assert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));

3   Fail
assert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));

l = 0.0175

Array indices must be positive integers or logical values. Error in sphere_distance (line 63) d = greatCircleDistance(p1*l, l(90-a1), l*p2, l*(90-a2), r) Error in Test3 (line 1) assert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));