How do I stop Matlab from creating temporary files (2020b and newer) or delete them programmatically?

조회 수: 22 (최근 30일)
I used to use Matlab 2018b for running simulations in both Matlab and Simulink without issue. I upgraded to 2020b and noticed Matlab now creates temporary files that are stored in my C:\Users\<username>\AppData\Local\Temp folder. Running Simulink.sdi.clear seems to help, but only when the simulation completely runs. Is there an easy way to stop Matlab from creating these files or a way to programatically delete temp files created by Matlab that are no longer being used?
If this question has already been answered, please send me the link. I've looked but I haven't found what I am looking for yet.

답변 (1개)

Steven Lord
Steven Lord 2024년 2월 14일
From your description and your mention of Simulink.sdi.clear resolving the problem, this sounds like it might be Bug Report 2507175. Can you try simulating your model in release R2021b (which the Bug Report lists as having fixed the bug) and see if the behavior persists?
  댓글 수: 1
Guy Squillace
Guy Squillace 2024년 2월 21일
I have run simulations in 2022a and have the same issue. Running Simulink.sdi.clear only helps when my program runs completely and reaches that line. During development I have simulations that have errors that kill my simulation or that crash Matlab entirely. I'm looking for a way to stop the creation of the temp data files all together or a command/script I can run at the beginning of my simulation to remove temp files left by previous runs or sessions that crashed.
Long story short, I am looking for a way to clean up my previous temp file mess or not to leave a mess to begin with.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by