How to hold a value in simulink ?
169 views (last 30 days)
Show older comments
Arthur MONVOISIN
on 25 Oct 2021
Commented: Arthur MONVOISIN
on 28 Oct 2021
Hello,
I search how to hold a value in my simulink model for an operation : I need to keep the latest value of my model and then add it to my signal until the input signal get to 0 again. It is like a vertical translation of my signal by the latest value calculated in the latest period.
Something like that : ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777953/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777953/image.jpeg)
Can a block in simulink do that or hold the latest value to add it to all the next iteration ?
Here is my simulink model :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777958/image.png)
K has the value 12.
A1 has the value 9.5e-5.
In input I have a custom repeating sequence from the fonction in the m file (force.m) : ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777963/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777963/image.png)
I'm sorry for the size of each screen capture, I don't know how to manage it.
Thank you for your time.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!