How do I stop simulink from creating large temp files?
23 views (last 30 days)
Show older comments
I am using Matlab 2022a. I have a simulation that runs a simulink model in a for loop. After each loop iteration, I output data from the simulink model to the workspace and save it in a .mat file. The next iteration overwrites the workspace and is saved in a separate .mat file. However, Matlab is creating very large DMR files with the naming convention xxxx-xxxx-xxxx-xxxx.dmr (xxxx is a hexidecimal value). There is also a large file called jetstream.dmr. These files are >1GB in size, and sometimes upward of 10GB. This is a problem since they are not being removed and fill my disk space. Is there a way to stop them from being generated or a way to clear them every time my model runs?
Accepted Answer
Sara Nadeau
on 13 Apr 2023
The DMR files might be related to logging. By default, most logged data logs to the Simulation Data Inspector, which retains simulation data for multiple runs so you can analyze it all together.
Running Simulink.sdi.clear after you save the MAT file will clear the data for that run.
You can also configure settings in the Simulation Data Inspector to control how much data is retained.
Here's some information about the options you have: https://www.mathworks.com/help/simulink/ug/limit-size-of-logged-data.html
Here's an example that shows how to disable the retention of data in the Simulation Data Inspector programmatically: https://www.mathworks.com/help/simulink/slref/simulink.sdi.setautoarchivemode.html
I am not sure whether this covers everything that you're seeing, but I hope it helps!
0 Comments
More Answers (0)
See Also
Categories
Find more on Sources 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!