%SGN    Sign
%   SGN(X) returns 1 if X is greater or equal to zero, and -1 if less
%   than zero.
%
% Syntax:  Y = sgn(X)
%
% Inputs:
%    X - Real number
%
% Outputs:
%    Y - 1 if X is greater or equal to zero, and -1 if less than zero.
%
% See also: SIGN

% Author: Travis Hydzik
% Last revision: 20 October 2004

function Y = sgn(X)

    Y = sign(sign(X) + 0.5);