How to store data in Simulink and reuse them before the simulation ends
Ältere Kommentare anzeigen
Hello everyone,
I want to store timeseries data during a Simulink simulation, mirror the input and give it back at another point later, but before the simulation ends. This is why I can not use a Sink block (To Workspace).
How is this possible?
Antworten (1)
Spruha
am 21 Feb. 2025
0 Stimmen
Hi Christos,
I see you want to store timeseries data during Simulink simulation and use it later, before the simulation ends.
You can use these blocks in your model.
- “Data Store Memory” block can store the time series data and let you use it later in the simulation.
- Use the “Data Store Write” block to write data to the “Data Store Memory” at the right moment during the simulation.
- If you want to mirror the data, use the “Data Store Read” block to get the data from the “Data Store Memory” and send it out.
You may refer to following Model:
- The "Data Store Write" block writes data(myData).
- The "Data Store Memory" block stores data.
- The "Data Store Read" block mirrors the stored data.
- A "Gain" block processes the data during the same simulation.
- A Scope verifies that the stored and read data are identical and processed input shows gain by 2.


You may refer to the following documentation about “Data Store Memory”, “Data Store Write” and “Data Store Read”
- https://www.mathworks.com/help/simulink/slref/datastorememory.html
- https://www.mathworks.com/help/simulink/slref/datastorewrite.html
- https://www.mathworks.com/help/simulink/slref/datastoreread.html
Hope this helps!
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!