deleteUnusedMFiles()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% (!!!!) WARNING, ACHTUNG, CUIDADO, ATTENTION: This function was created to
% help the user DELETE unused files in an automated way. Use it CAREFULLY
% and under your own responsability. I DO NOT TAKE ANY RESPONSABILITY for
% any damage caused to your computer/files!!!!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function searches for unused m files and let's the user delete
% them, or make a copy to a backup directory before deleting them.
% The procedure is simple: the native matlab's function
% matlab.codetools.requiredFilesAndProducts( 'filename_function.m' ),
% analyzes the function 'filename_function.m' in the current directory
% (pwd) and finds all dependant functions. In other words, this function
% returns all functions that are required for 'filename_function.m' to work
% properly. When a function does not require any other function to run
% apart from itself, matlab will just return the name of the function itself.
% Therefore, we can analyze all m files in a certain directory and find
% which functions are required for each file. We concatenate all these
% 'USED & REQUIRED' files in a variable. After checking all files, we
% compare the used & required files with the list of filenames on that
% directory. The filenames that don't appear in the used & required list
% are the functions that aren't called by anyone apart from themselves.
% This can have two meanings: 1) This function is a MAIN function that
% calls other subfunctions but is not called by anyone (like if you create
% a main GUI file/script) or 2) This function is not used and can be safely
% removed from this directory.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Citar como
Mbvalentin (2024). deleteUnusedMFiles() (https://www.mathworks.com/matlabcentral/fileexchange/59883-deleteunusedmfiles), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |