sign

Purpose

Signum function.

Synopsis

Y = sign(X)

Description

Y = sign(X) returns a matrix Y the same size as X, where each element of Y is

  • 1 if the element is greater than zero
  • 0 if it equals zero
  • -1 if it is less than zero
    For nonzero complex X, sign(X) = X./abs(X).

    See Also

    abs, conj, imag, real
    

    (c) Copyright 1994 by The MathWorks, Inc.