Simulink联合PX4硬件在环仿真临时文件占C盘空间过大问题,请问如何解决?
15 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Anushka
on 20 Jun 2025
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!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!