Sign
R2026bIndicate sign of input
Libraries:
Simulink /
Math Operations
HDL Coder /
HDL Floating Point Operations
HDL Coder /
Math Operations
Description
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 |
When the input u is a complex scalar, the block output matches the
MATLAB® result for:
sign(u) = u./ abs(u)
| (1) |
Examples
Extended Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"simulink/Math Operations/Sign"
"hdlsllib/HDL Floating Point Operations/Sign"
"hdlsllib/Math Operations/Sign"
Example: add_block("simulink/Math Operations/Sign","myModel/myBlock",MakeNameUnique="on")
For information about programmatic access to individual block parameters, see the Programmatic Use section of parameter descriptions on this page.
Extended Capabilities
Version History
Introduced before R2006a



