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

13 visualizaciones (últimos 30 días)
Shengjian
Shengjian el 21 de Feb. de 2025
Respondida: Anushka el 20 de Jun. de 2025
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?

Respuestas (1)

Anushka
Anushka el 20 de Jun. de 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!

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by