Triggered sample and hold

control.sample_hold

Samples the input each time the trigger input rises above 0.5 and holds that value until the next rise. The output is 0 until the first trigger.

Ports

NameDomainDirection
usignalin
triggersignalin
ysignalout

Variables

NameUnitDescription
held1Last sampled input

Equations

der(held) = 0
when trigger > 0.5 then reinit(held, u)
y = held