MATLAB: Remove outlier in large data

outlier std mean

my question how to find outlier in matlab explain by code and example ? and how many methods ? how to find outlier?

Best Answer

Try this:
% data = the variable name of your array
stdDev = std(data(:)) % Compute standard deviation
meanValue = mean(data(:)) % Compute mean
zFactor = 1.5; % or whatever you want.
% Create a binary map of where outliers live.
outliers = abs(data-meanValue) > (zFactor * stdDev);