function varargout = repelem(X, varargin)
%REPELEM Replicate elements of an array.
%   U = REPELEM(V,N)
%   B = REPELEM(A, R1, ..., RN)
%   
%   See also REPELEM, GPUARRAY.


%   Copyright 2016-2019 The MathWorks, Inc.

if nargin>1
    [varargin{:}] = gather(varargin{:}); % Only the first input is allowed to be remote
end

% try...catch prevents error being reported by internal
try
    [varargout{1:nargout}] = matlab.internal.builtinhelper.repelem(X, varargin{:});
catch ME
    throw(ME);
end
