function [B,I] = rmoutliers(A,varargin)
%RMOUTLIERS Remove outliers from data
%   
%   B = RMOUTLIERS(A)
%   B = RMOUTLIERS(A,DIM)
%   B = RMOUTLIERS(A,...,METHOD)
%   B = RMOUTLIERS(A,...,'Percentiles',[LP UP])
%   B = RMOUTLIERS(A,...,MOVMETHOD,WL)
%   B = RMOUTLIERS(A,..., 'MinNumOutliers',N)
%   B = RMOUTLIERS(A,..., 'ThresholdFactor', P)
%   B = RMOUTLIERS(A,..., 'MaxNumOutliers', MAXN)
%   [B,I] = RMOUTLIERS(A,...)
%   
%   Limitations:
%   1. The following syntaxes are not supported:
%      B = RMOUTLIERS(A,..., 'SamplePoints',X)
%      B = RMOUTLIERS(A,..., 'DataVariables',DV)
%   2. The "movmedian" METHOD is not supported.
%   
%   
%   See also: RMOUTLIERS, GPUARRAY.
%   


%   Copyright 2019 The MathWorks, Inc.

% Only A is allowed to be remote.
if nargin>1
    [varargin{:}] = gather(varargin{:});
end
% If A is not remote this will now run on client.
if nargout>1
    [B,I] = matlab.internal.math.rmMissingOutliers('rmoutliers',A,varargin{:});
else
    B = matlab.internal.math.rmMissingOutliers('rmoutliers',A,varargin{:});
end