| Simulink® | ![]() |
Discrete

The Difference block outputs the current input value minus the previous input value.
The Difference block accepts signals of any data type supported by Simulink® software, including fixed-point data types.
The Main pane of the Difference block dialog appears as follows:

Set the initial condition for the previous output.
The Signal Attributes pane of the Difference block dialog appears as follows:

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
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, float('single')
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.
Select to lock scaling of outputs. This parameter is visible only if you enter an expression for the Output data type parameter.
Rounding mode for the fixed-point output. For more information, see Rounding in the Simulink® Fixed Point™ User's Guide.
If selected, fixed-point overflows saturate.
Direct Feedthrough | Yes |
Scalar Expansion | Yes, of inputs and gain |
![]() | Detect Rise Positive | Digital Clock | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |