Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xplore
See also: abs

Macro: sign
Description: Computes the sign function (0, -1, 1) for zeros, negative or positive values.

Usage: s = sign (x)
Input:
x array
Output:
s array containing signs for all values of x

Example:
library("xplore")
randomize (0)
x = normal (2, 3) ~ (0|0)
sign (x)
Result:

Contents of s
[1,]       -1        1       -1       0
[2,]       -1       -1        1       0

Library: xplore
See also: abs

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: TTK, 970617
(C) MD*TECH Method and Data Technologies, 17.8.2000