Instead of going through the tedious (and potentially risky) task of inserting all your m files into one to run MLINT , you have a few more options ...
If you have all your files in one folder, the easiest way is to go to the browser of the current folder, click Actions
, and then select Reports> Report Code Analyzer .

This will open a new window displaying the MLINT results for each m file in the current directory:

If you prefer to automate the process using a script instead of clicking on the menu options, there are several views on MathWorks file sharing ( here and here ) that seem to work recursively in the directory structure, and not just in one directory.
In addition, here is an example of code that will do what you want for a single directory:
dirData = dir; %
You can expand the collection of file names (and paths) so that they work recursively in the directory tree , then run MLINT in the resulting set of files that you collect.
gnovice
source share