Indicate sign of input
For real inputs, the Sign block outputs the sign of the input:
|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:
The Sign block supports real inputs of the following data types:
The block supports complex inputs only for floating-point data
output uses the same data type as the input.
For more information, see Data Types Supported by Simulink in the Simulink® documentation.
Select to enable zero-crossing detection. For more information, see Zero-Crossing Detection.
This parameter is not visible in the block dialog box unless
it is explicitly set to a value other than
To learn more, see Blocks for Which Sample Time Is Not Recommended.
The following Simulink examples show how to use the Sign block:
sldemo_fuelsys (in the Engine Gas
Dynamics/Throttle & Manifold/Throttle subsystem)
Double | Single | Boolean | Base Integer | Fixed-Point
Inherited from driving block
Yes, if enabled