Simulink file size keeps on increasing!

4 views (last 30 days)
Whenever I open the simulink .slx file, run the simulation, save the model and close... the file size keeps on incresing (sometimes even twice). Now the current size of file is 60MB(from 80KB) thus takes lot of time to open or save.
This only occurs when I open the model. Saving again and again while running the model doesn't increase the size. Perhaps I changed some important settings in simulink?
Please help what should I change so that I can decrease the size to its original.
Thanks in advance.
edit:
I tried various thing.. one thing that worked was closing other windows of same simulink model. It stopped increasing the size. Do anyone know why would that occur. Also how can I decrease the size back to original?
Thanks

Accepted Answer

Matthias Höfle
Matthias Höfle on 18 Mar 2020
Found a solution for this particular problem from Mathworks:
Repeatedly saving models that open in multiple Simulink Editor windows causes slower model openingFix Options
Description
When you save a Simulink model with two or more Simulink Editor windows open, information is stored in the model file to recreate those windows when the model is later reopened. However, in some circumstances, that information might increase in size with each save cycle. Eventually, this extra information can slow down the process of reopening and resaving the model.
Workaround
You can avoid this problem with either of the following:
  • Close all but one Simulink Editor window before saving the model. This mitigates additional file size increases due to extra window information, but it may not reduce the number of copies already created.
  • Export the model to R2019a. The duplicated information is excised from the R2019a version of the model. This workaround is not applicable if your model requires R2019b features.

More Answers (1)

Matthias Höfle
Matthias Höfle on 11 Mar 2020
Edited: Matthias Höfle on 11 Mar 2020
I got the same problem. Simulink Model running (with real-time kernel) on MATLAB R2019B saved as *.mdl increased filesize from approx. 4 MB up to 80 MB/300 MB depending on how many windows were opened before saving. Had the same experience as Rohit Bhor mentioned. Must be dependent on how many windows of the same model are opened during save/execution process. I can't decrease the size by closing these windows and saving the model thereafter either.
It definitely matters to solve that problem, because performance decreases drastically with increasing filesize. Are there temporary files stored?
Support please help. Don't want to go to the weeks old backup model back and apply all changes again.

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!