Simulink联合​PX4硬件在环仿真临​时文件占C盘空间过大​问题,请问如何解决?

조회 수: 11 (최근 30일)
Shengjian
Shengjian 2025년 2월 21일
답변: Anushka 2025년 6월 20일
When Simulink and PX4 carried out hardware-in-the-loop simulation, the space of the C drive dropped sharply, so how long can these temporary files be stored in which path?

답변 (1개)

Anushka
Anushka 2025년 6월 20일
When performing Hardware-in-the-Loop (HIL) simulation with PX4 in Simulink, temporary files can accumulate on your ‘C’ drive, potentially consuming significant disk space. These temporary files are typically stored in the following paths:
1. They are stored in the 'MATLAB Temporary Directory'. This is usually located at “C:\Users\<YourUsername>\AppData\Local\Temp”. You can check the specific path by using the command “tempdir” in MATLAB.
You can refer to the following documentation of “tempdir” to get a better understanding: https://www.mathworks.com/help/matlab/ref/tempdir.html
2. Simulink may also create cache files in the project directory or in the working directory where your Simulink model is saved.
To manage disk space, you can periodically clear these temporary files. MATLAB does not automatically delete these files, so it's advisable to do this manually or set up a script to clean them up after simulations.
Here’s a sample MATLAB script to delete temporary files:
tempDir = tempdir;
delete(fullfile(tempDir, '*.*')); % Deletes all files in the temp directory
disp('Temporary files deleted from MATLAB temp directory.');
Make sure to run this script when you are certain that no important files are in the temporary directory, as it will delete all files within it.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by