![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1606611/image.png)
Hold signal value in after a trigger then resume with the rest of the signal
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I have a signal in simulink that looks like this: [1 2 3 4 5 6 7 8 9 10] I would like to run the simulation and when I hit a trigger action the signal would hold its current value, for example the output would be [1 2 3 4 5 5 5 5 5 5 5 5 5 5 5....] for an indefinite amount of time until I hit a trigger action that would continue logging the signal from where it stopped, for example [.... 5 5 5 5 5 5 6 7 8 9 10]. The examples on the web I have seen only hold the value of the signal but it does not continue where it left off but rather it continues the signal at a certain point ahead in time missing some portion of the signal. I would appreciate any help, Thank you!
0 Kommentare
Antworten (1)
Dimitri MANKOV
am 2 Feb. 2024
Hi Yan,
What about a triggered subsystem containing your counter, like in the picture below? That counter would only be incremented if a trigger is received and would be held at its current value otherwise.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1606611/image.png)
Best,
Dimitri
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sources finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!