How to latch the value of an array signal at a particular timestep using Simulink

12 次查看(过去 30 天)
Hi,
How to latch(hold) the value of an array signal of size 200(input), if a required condition is met(condition may be provided using a Switch block) at a particular timestep using Simulink ?
The input needs to be latched at that instant when the condition to latch the value becomes true and it should hold that value throughout.
Note: The array input is uint8 type.
Any feedback is appreciated.

回答(1 个)

Abhaya
Abhaya 2024-9-2
Hi Geethika,
To latch the value of a signal at a particular timestep, you can use Simulink “Enabled subsystem” block in the Simulink model. Set the "Output when disabled" property of the subsystem's "Outport" block to "held" to maintain its last value when the subsystem is disabled.
The condition for enabling the subsystem can be provided by Simulink “Switch” block or Simulink comparator blocks.
An example model for holding the value of a signal is provided below.
To explore other methods to hold a value of a signal please follow the blog link given below.

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by