checkcode for file or folder
mlintrpt scans all MATLAB® code files
in the current folder for Code Analyzer messages and reports the results
in a MATLAB web browser.
mlintrpt on the example file
lengthofline.m. MATLAB® displays a report of potential problems and improvements for
mlintrpt on all examples in the MATLAB® example folder
matlabroot/matlab/help/techdoc/matlab_env/examples. MATLAB displays a report of potential problems and improvements for all MATLAB code files in this folder.
Suppress specific messages in a report by creating and specifying a settings file. For example, the file
lengthofline.m includes several lines that use | instead of || as the
OR operator. By default,
mlintrpt flags these lines.
Create a settings file that suppresses the message flagging the use of | as the
On the Home tab, in the Environment section, click the Preferences button.
Select Code Analyzer in the left pane.
Under Default Settings, in the Aesthetics and Readability section, clear the message Use || instead of | as the OR operator in (scalar) conditional statements.
mysettings.txt as the file name and save it to your current folder.
Press the Cancel button to exit out of the preference panel without changing the active settings.
mlintrpt on the example file using the custom settings file
mysettings.txt. The message Use || instead of | as the OR operator in (scalar) conditional statements is suppressed and is no longer visible in the report.
f— File or folder name
File or folder name, specified as a character vector. The file name can include a partial path, but must be in a folder on the search path, or in the current folder.
inputType— Input type
Input type, specified as
'file' if the input
is a file or
'dir' if the input is a folder.
settingsfile— Settings file name
Settings file name, specified as a character vector. If the file is not in the current folder, provide the full path to the file.
For information about creating a settings
file, see Save and Reuse Code Analyzer Message Settings.
If you specify an invalid file, the first message in the report is
Unable to open or read the configuration file 'mymlint.txt'--using