Desktop Tools and Development Environment |
|
M-Lint Graphical User Interface (GUI)
- Create, run, and debug an M-file, or multiple M-files in a directory.
- In the Current Directory browser, navigate to the directory that contains the M-files you want to check with M-Lint. In the toolbar, select the
M-Lint Code Check Report
from the Directory Reports listing. For the example shown, go to $matlabroot/matlab/help/techdoc/matlab_env/examples
to use M-Lint to check lengthofline.m
.
- The M-Lint Code Check Report displays in the MATLAB Web browser, showing those M-files that M-Lint identified as having potential problems or opportunities for improvement.
- For each message, review the message and code and make changes to the code based on the message as described here:
- Click the line number to open the M-file in the Editor/Debugger at that line.
- Review the M-Lint message in the report and change the code in the M-file, based on the message.
- Note that in some cases, you should not make any changes based on the M-Lint messages because the M-Lint messages do not apply to that specific situation. M-Lint does not provide perfect information about every situation. In the event you do not want to change the code but you also do not want to see the M-Lint message for that line in the M-Lint Report, suppress the message by adding
%#ok
to the end of the statement in the M-file.
- Save the M-file. Consider saving the file to a different name if you made significant changes that might introduce errors. Then you can refer to the original file as you resolve problems with the updated file. Use the File Comparison Report, a tool that can help you identify the changes you made in the updated file. For more information, see File Comparison Report.
- If you are not sure what a message means or what to change in the code as a result, use the Help browser to look for related topics in the online documentation. For examples of messages and what to do about them, see Making Changes Based on M-Lint Messages.
- Run and debug the file(s) again to be sure you have not introduced any inadvertent errors.
- If the M-Lint Code Check Report is already displayed, click the Refresh button to update it, or run the M-Lint Code Check Report again. Ensure the M-Lint messages are gone, based on the changes you made to the M-files.
| M-Lint Code Check Report | | Making Changes Based on M-Lint Messages | |
© 1994-2005 The MathWorks, Inc.