Problem 60831. "Identify and Replace Outliers in a Numeric Array"
Given a numeric array, identify outliers that are more than two standard deviations away from the mean and replace them with the mean of the non-outlier values.
Example:
Input:
x = [10, 12, 11, 50, 13, 9, 12, 8, 11, 200];
Processing:
- The mean and standard deviation of the array are calculated.
- Values that are more than 2 standard deviations from the mean are considered outliers.
- Outliers are replaced by the mean of the remaining non-outlier elements.
Output:
y = [10, 12, 11, 13, 13, 9, 12, 8, 11, 13];
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!