deleteUnusedMFiles(​)

Version 1.0.0.0 (8,24 ko) par Mbvalentin
This function aims to help the user delete unused .m files in a certain directory automatically
59 téléchargements
Mise à jour 22 oct. 2016

Afficher la licence

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% (!!!!) 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.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Citation pour cette source

Mbvalentin (2025). deleteUnusedMFiles() (https://www.mathworks.com/matlabcentral/fileexchange/59883-deleteunusedmfiles), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2014a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0