David
Farruggio

MathGenie

sign

Sign function (signum function)

Syntax and Description

sign(x) returns an array Y the same size as x, where each element of Y is:
  • 1 if the corresponding element of x is greater than 0.
  • 0 if the corresponding element of x equals 0.
  • -1 if the corresponding element of x is less than 0.
  • x./abs(x) if x is complex.

Back to functions