Clear Filters
Clear Filters

Is it possible to log data for a certain previous amount of time, on a rolling basis, on one simulation run, with the file log block?

1 view (last 30 days)
I'm hoping that there's a way to use a file log block to record data for a run for only a specified amount of time, on a rolling basis. In my case, I would like to log the previous two minutes of data at any given time. I know this isn't achievable with the vanilla block, so I imagine I'm going to have to do some type of manipulation in the model or with SDI.
When we run our simulation, it typically runs for 18 hours on a single run, and we need the capability to record about 300 double data points at a 5ms rate. We obviously don't want to record the data for the whole run, as that would get quite big very quickly, and transferring and processing data would become quite cumbersome. We also only need to record times when certain events happen for troubleshooting.

Answers (1)

Balavignesh
Balavignesh on 27 Apr 2023
Hi Gresham,
As per my understanding, you would like to know if it is possible to log data for a certain previous amount of time by saving values for a moving window using the “To File” block.
However, “To File” block allows you to control the sample time and does allow you not log the data on a rolling basis. You can refer to the following documentation link to know more about “To File” block:
I hope this answers your queries.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!