This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Detect Fall Negative

Detect falling edge when signal value decreases to strictly negative value, and its previous value was nonnegative

  • Library:
  • Simulink / Logic and Bit Operations

Description

The Detect Fall Negative block determines if the input is less than zero, and its previous value is greater than or equal to zero.

Ports

For more information, see Data Types Supported by Simulink in the Simulink® documentation.

Input

expand all

Input signal, specified as a scalar, vector, or matrix.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated

Output

expand all

Output signal, true (equal to 1) when the input signal is less than zero, and its previous value was greater than or equal to zero; false (equal to 0) when the input signal is greater than or equal to zero, or if the input signal is negative, its previous value was also negative.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Parameters

expand all

Set the initial condition of the Boolean expression U/z < 0.

Programmatic Use

Block Parameter: vinit
Type: character vector
Values: scalar | vector
Default:'0'

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. The block accepts frame-based signals for the input u. All other input signals must be sample-based.

Input Signal uInput Processing ModeBlock Works?
Sample basedSample basedYes
Frame basedNo, produces an error
Sample basedFrame basedYes
Frame basedYes

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)'

Set the output data type to boolean or uint8.

Programmatic Use

Block Parameter: OutDataTypeStr
Type: character vector
Values: 'boolean' | 'uint8'
Default: 'boolean'

Block Characteristics

Data Types

Boolean | double | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

Introduced before R2006a