Cody

Problem 42485. Eliminate Outliers Using Interquartile Range

Solution 2862974

Submitted on 20 Aug 2020 by Dennis Gimlin
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
data = [53,55,51,50,60,52]; correct_data = [53,55,51,50,52]; assert(isequal(remove_outlier(data),correct_data))

sdat = 50 51 52 53 55 60 sdat = 50 51 52 53 55

2   Pass
data = [0,0,0,0,0]; correct_data = [0,0,0,0,0]; assert(isequal(remove_outlier(data),correct_data))

sdat = 0 0 0 0 0

3   Pass
data = [1,2,3,4,5,100,100,6,7,8]; correct_data = [1,2,3,4,5,6,7,8]; assert(isequal(remove_outlier(data),correct_data))

sdat = 1 2 3 4 5 6 7 8 100 100 sdat = 1 2 3 4 5 6 7 8

4   Pass
data = [-54,-30,-45,-40,0,-33]; correct_data = [-54,-30,-45,-40,-33]; assert(isequal(remove_outlier(data),correct_data))

sdat = -54 -45 -40 -33 -30 0 sdat = -54 -45 -40 -33 -30

5   Pass
data = [63,64,64,63,53,61,65,63,52,50,65,61,68,137,62,60,64,67,65,63,63,63]; correct_data = [63,64,64,63,65,63,65,62,64,65,63,63,63]; assert(isequal(remove_outlier(data),correct_data))

sdat = 50 52 53 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 68 137 sdat = 50 52 53 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 68 sdat = 52 53 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 68 sdat = 53 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 68 sdat = 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 68 sdat = 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 67 sdat = 60 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 sdat = 61 61 62 63 63 63 63 63 63 64 64 64 65 65 65 sdat = 62 63 63 63 63 63 63 64 64 64 65 65 65

6   Pass
data = [1,2,3,4,5,6,7]; correct_data = [1,2,3,4,5,6,7]; assert(isequal(remove_outlier(data),correct_data))

sdat = 1 2 3 4 5 6 7

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!