sign 函数
Signum function
符号函数
Syntax
语法
Y = sign(X)
Description
描述
Y = sign(X) returns an array Y the same size as X, where each element of Y is:
Y=sign(X)返回一个阵列Y,与X的大小相同,在这里Y的每个元素是:
·1 if the corresponding element of X is greater than zero
1如果X相应的元素大于零。
·0 if the corresponding element of X equals zero
0如果X相应的元素等于零
·-1 if the corresponding element of X is less than zero
-1如果X相应的元素小于零
For nonzero complex X, sign(X) = X./abs(X).
非零复数X,sign(X)=X./abs(X)。