Detect Increase
Detect increase in signal value
Libraries:
Simulink /
Logic and Bit Operations
HDL Coder /
Logic and Bit Operations
Description
The Detect Increase block determines if an input is strictly greater than its previous value.
The output is true (equal to
1
) when the input signal is greater than its previous value.The output is false (equal to
0
) when the input signal is less than or equal to its previous value.
This block supports only discrete sample times.
Examples
Detect Increasing Signal Values with the Detect Increase Block
This example shows how to use the Detect Increase Block to detect increasing signal values. Because the Initial condition is set to -1
, the block detects an increasing signal value starting at time t=0
. If you change the Initial condition parameter to a nonnegative value, the block detects the first increasing signal value at t=0.25
.
Ports
Input
Port_1 — Input signal
scalar | vector | matrix
Input signal, specified as a scalar, vector, or matrix.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
Output
Port_1 — Output signal
scalar | vector | matrix
Output signal, detecting an increase in signal value, specified as a scalar, vector, or matrix.
The output is true (equal to
1
) when the input signal is greater than its previous value.The output is false (equal to
0
) when the input signal is less than or equal to its previous value.
Data Types: uint8
| Boolean
Parameters
Initial condition — Initial condition of previous input
0.0
(default) | scalar | vector | matrix
Set the initial condition for the previous input
U/z
.
Programmatic Use
Block Parameter:
vinit |
Type: character vector |
Values: scalar | vector | matrix |
Default:
'0.0' |
Input processing — Specify sample- or frame-based processing
Elements as channels (sample based)
(default) | Columns as channels (frame based)
Specify whether the block performs sample- or frame-based processing:
Columns as channels (frame based)
— Treat each column of the input as a separate channel (frame-based processing).Note
Frame-based processing requires a DSP System Toolbox™ license.
For more information, see Sample- and Frame-Based Concepts (DSP System Toolbox).
Elements as channels (sample based)
— Treat each element of the input as a separate channel (sample-based processing).
Use Input processing to specify whether the block performs sample- or frame-based processing. For more information about these two processing modes, see Sample- and Frame-Based Concepts (DSP System Toolbox).
Programmatic Use
Block Parameter:
InputProcessing |
Type: character vector |
Values: 'Columns as channels
(frame based)' | 'Elements as channels (sample
based)' |
Default: 'Elements as channels
(sample based)' |
Output data type — Output data type
boolean
(default) | uint8
Specify the output data type as boolean
or
uint8
.
Programmatic Use
Block Parameter:
OutDataTypeStr |
Type: character vector |
Values:
'boolean' | 'uint8' |
Default:
'boolean' |
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Generated code relies on memcpy
or
memset
functions (string.h
) under
certain conditions.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has one default HDL architecture.
ConstrainedOutputPipeline | Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is
|
InputPipeline | Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
OutputPipeline | Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)