Programmer Guide/Command Reference/EVAL/sign: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:
:;<var>x</var>: a scalar, vector or matrix
:;<var>x</var>: a scalar, vector or matrix
;Result: The result ''r'' has the same type as the argument ''x''.
;Result: The result ''r'' has the same type as the argument ''x''.
::<code>''x''[''i'',''j''] is set to 1 if ''x''[''i'',''j'']>=0 and to -1 if ''x''[''i'',''j'']>=0</code>
::<code>''r''[''i'',''j''] is set to 1 if ''x''[''i'',''j'']>=0 and to -1 if ''x''[''i'',''j'']>=0</code>
;See also: [[Programmer_Guide/Command_Reference/EVAL/int|int]], [[Programmer_Guide/Command_Reference/EVAL/round|round]], [[Programmer_Guide/Command_Reference/EVAL/floor|floor]]  
;See also: [[Programmer_Guide/Command_Reference/EVAL/int|int]], [[Programmer_Guide/Command_Reference/EVAL/round|round]], [[Programmer_Guide/Command_Reference/EVAL/floor|floor]]  


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 11:56, 4 April 2011

Compute the sign.

Usage
sign(x)
x
a scalar, vector or matrix
Result
The result r has the same type as the argument x.
r[i,j] is set to 1 if x[i,j]>=0 and to -1 if x[i,j]>=0
See also
int, round, floor

<function list>

Navigation menu

Personal tools