Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Difference - Calculate change in signal over one time step

Library

Discrete

Description

The Difference block outputs the current input value minus the previous input value.

Data Type Support

The Difference block accepts signals of any numeric data type supported by Simulink software, including fixed-point data types.

Parameters and Dialog Box

The Main pane of the Difference block dialog box appears as follows:

Initial condition for previous output

Set the initial condition for the previous output.

The Signal Attributes pane of the Difference block dialog box appears as follows:

Output minimum

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Output maximum

Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:

Output data type

Specify the output data type. You can set it to:

  • A rule that inherits a data type, for example, Inherit: Inherit via back propagation

  • The name of a built-in data type, for example, single

  • The name of a data type object, for example, a Simulink.NumericType object

  • An expression that evaluates to a data type, for example, fixdt(1,16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output data type parameter.

See Specifying Block Output Data Types for more information.

Lock output data type setting against changes by the fixed-point tools

Select to lock the output data type setting of this block against changes by the Fixed-Point Tool and the Fixed-Point Advisor. For more information, see Fixed-Point Tool and Fixed-Point Advisor in the Simulink Fixed Point documentation.

Integer rounding mode

Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink Fixed Point User's Guide.

Saturate to max or min when overflows occur

If selected, fixed-point overflows saturate. Otherwise, they wrap.

Characteristics

Direct Feedthrough

Yes

Scalar Expansion

Yes, of inputs and gain

  


Related Products & Applications

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

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