Skip to Main Content Skip to Search
Product Documentation

Sign - Indicate sign of input

Library

Math Operations

Description

Block Behavior for Real Inputs

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

InputOutput
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:

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.

Parameters and Dialog Box

Enable zero-crossing detection

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

Sample time (-1 for inherited)

Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See How to Specify the Sample Time in the Simulink documentation for more information.

Examples

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

Characteristics

Direct Feedthrough

Yes

Sample Time

Specified in the Sample time parameter

Scalar Expansion

N/A

Dimensionalized

Yes

Multidimensionalized

No

Zero-Crossing Detection

Yes, if enabled

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS