Sign
Indicate sign of input
Libraries:
Simulink /
Math Operations
HDL Coder /
HDL Floating Point Operations
HDL Coder /
Math Operations
Description
Block Behavior for Real Inputs
For real inputs, the Sign block outputs the sign of the input:
Input  Output 

Greater than zero  1 
Equal to zero  0 
Less than zero  –1 
The Sign Block Behavior for Real Inputs example shows that, for vector and matrix inputs, the block outputs a vector or matrix where each element is the sign of the corresponding input element.
Block Behavior for Complex Inputs
When the input u
is a complex scalar, the block output matches
the MATLAB^{®} result for:
sign(u) = u./ abs(u)
The Sign Block Behavior for Complex Issues example shows that when an element of a vector or matrix input is complex, the block uses the same formula that applies to scalar input.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Extended Capabilities
Version History
Introduced before R2006a