How can I save the input value in the moment of activating a subsystem?

Hello,
I have a subsytem in Simulink with a variable input and I want to save the value of this input in the moment of activation of the subsystem. The subsystem is activated by an "If-Block".
I thought about saving the value with a "Data Store Write" Block. I need a Block in front of that, that lets the signal through only at the first step and afterwards blocks the signal. Or something like that.
Any ideas how I could do that?
Thanks in advance!

3 Comments

No ideas anyone? There has to be a way..
Is my question unclear? Should I be more precise? I thought the solution for this problem is not that complicated. But as I am new to Matlab and Simulink I have no idea how to do it.
Okay, I finally found out how to do it.
I have a Constant Block set to Zero and after that a Memory Block with initial condition 1. This activates a enabled subsystem which has nothing in it but a connection from the input to output. It is only activated in the first step. After that it will continue putting out the value it had while it was activated.
Thank you anyway!

Answers (0)

This question is closed.

Products

Asked:

on 13 Jun 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!