This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Indicate sign of input


Math Operations


Block Behavior for Real Inputs

For real inputs, the Sign block outputs the sign of the input:

Greater than zero1
Equal to zero0
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:

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)

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 Type Support

The Sign block supports real inputs of the following data types:

  • Floating point

  • Built-in integer

  • Fixed point

  • Boolean

The block supports complex inputs only for floating-point data types, double and single. The output uses the same data type as the input.

For more information, see Data Types Supported by Simulink in the Simulink® documentation.


Enable zero-crossing detection

Select to enable zero-crossing detection. For more information, see Zero-Crossing Detection.

Sample time


The following Simulink examples show how to use the Sign block:

  • sldemo_fuelsys (in the Engine Gas Dynamics/Throttle & Manifold/Throttle subsystem)

  • sldemo_hardstop


Data Types

Double | Single | Boolean | Base Integer | Fixed-Point

Sample Time

Inherited from driving block

Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection

Yes, if enabled

Code Generation


Introduced before R2006a

Was this topic helpful?