Cody

# Problem 661. Spot the outlier

Solution 218739

Submitted on 19 Mar 2013 by Ted
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
%% pts = [0 1; 0 2; 3 2; 0 3; 0 4 ]; outlier = 3; assert(isequal(spot_the_outlier(pts),outlier))

``` slope = -Inf b = NaN b = NaN NaN b = NaN NaN Inf b = Inf ```

2   Pass
%% pts = [10 -1;7 0;9.5 0.3;9 1.6;8.5 2.9]; outlier = 2; assert(isequal(spot_the_outlier(pts),outlier))

``` slope = -2.6000 b = 25 b = 25.0000 18.2000 b = 25.0000 18.2000 25.0000 b = 25 ```

3   Pass
%% pts = [-0.6 -6;-0.2 0;0 3;-0.8 -9;-2 1;-0.4 -3]; outlier = 5; assert(isequal(spot_the_outlier(pts),outlier))

``` slope = 15 b = 3 b = 3 3 b = 3 3 3 b = 3 ```

4   Pass
%% pts = [2 5;0 4;0 0;4 6;-2 3]; outlier = 3; assert(isequal(spot_the_outlier(pts),outlier))

``` slope = 0.5000 b = 4 b = 4 4 b = 4 4 0 b = 4 ```

5   Pass
%% pts = [1 0; 0 1; 1 2; 1.5 2.5; 2 3; 3 4 ]; outlier = 1; assert(isequal(spot_the_outlier(pts),outlier))

``` slope = 1 b = -1 b = -1 1 b = -1 1 1 b = 1 ```