Indicate sign of input
Simulink / Math Operations
HDL Coder / HDL Floating Point Operations
HDL Coder / Math Operations
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 |
For vector and matrix inputs, the block outputs a vector or matrix where each element is the sign of the corresponding input element, as shown in this example:
When the input u
is a complex scalar, the block output matches
the MATLAB® result for:
sign(u) = u./ abs(u)
When an element of a vector or matrix input is complex, the block uses the same formula that applies to scalar input, as shown in this example:
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|