%% Matrix of Data
% Fill outliers for each row of a matrix.
% Create a matrix of data containing outliers along the diagonal.

A = randn(5,5) + diag(1000*ones(1,5))

%
% Fill outliers with zeros based on the data in each row, and display the new values.

[B,TF,lower,upper,center] = filloutliers(A,0,2);
B

%
% You can directly access the detected outlier values and their filled values using TF as an index vector.

[A(TF) B(TF)]

%
% Copyright 2012 The MathWorks, Inc.