function varargout = unwrap(varargin)
%UNWRAP Unwrap phase angle.
%   Q = UNWRAP(P)
%   Q = UNWRAP(P,TOL)
%   Q = UNWRAP(P,[],DIM)
%   Q = UNWRAP(P,TOL,DIM)
%   
%   Example:
%    
%       % Create a sawtooth phase signal wrapping from +pi to -pi
%       noise = rand(1, 10000, 'gpuArray') - 0.5;
%       P = repmat(gpuArray.linspace(-pi, pi, 1000), 1, 10) + noise;
%   
%       % Unwrap to retrieve linear trend
%       Q = unwrap(P);
%   
%       % Display result
%       subplot(1, 2, 1);
%       plot(P);
%       subplot(1, 2, 2);
%       plot(Q);
%   
%   See also UNWRAP, GPUARRAY, GPUARRAY/ANGLE, GPUARRAY/ABS.


%   Copyright 2014 The MathWorks, Inc.

% try...catch prevents error being reported by internal
try
    [varargout{1:nargout}] = parallel.internal.flowthrough.unwrap(varargin{:});
catch ME
    throw(ME);
end
