Sign

Parent Previous Next

Sign


Signum function



Syntax


Sign(x)

x is real scalar

Return 1 if x>0, 0 if x = 0, and -1 if x < 0

x is complex scalar

Return the result of x / Abs(x)

x is matrix

Return a matrix in which the element is the Signum function value of the element in x


Example


Input

Output

sign(-0.9)

sign(1 + 2i)

sign([1+i, 0, 1-i])

sign([i, 1-3i; -2i, 5])


See Also


Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source