falling - Detect falling edge in data since last time step in Stateflow chart - MATLAB (original) (raw)

Main Content

Detect falling edge in data since last time step in Stateflow chart

Since R2021b

Syntax

Description

tf = falling(`expression`) returns 1 (true) if:

Otherwise, the operator returns 0 (false). Ifexpression changes value from positive to zero to negative at three consecutive time steps, the operator detects a single edge when the value ofexpression becomes zero.

The argument expression:

Index elements of a matrix by using numbers or expressions that evaluate to a constant integer.

example

Note

Edge detection is supported only in Stateflow® charts in Simulink models.

Examples

expand all

Transition out of state if the value of the input datasignal falls below a threshold of 2.5.

Stateflow chart that uses the falling operator in a transition.

The falling edge is detected when the value of the expressionsignal-2.5 becomes zero or negative.

Tips

Version History

Introduced in R2021b