Installation guide

7 Tuning and Managing M-Files
M-Lint does not provide perfect information about every situation and
in some cases, you might not want to make any changes based on the
M-Lint message. In the event you do not want to change the code but you
alsodonotwanttoseetheM-LintmessageforthatlineintheM-Lint
Report, instruct M-Lint to ignore a line by adding
%#ok to the end of
the line in the M-file. (You can override the
%#ok by running the mlint
function with the '-notok' tag.)
If there are certain messages or t y pes of messages you do not want to
see, you can set a prefere nce so that M-Lint does not report them. Select
File > Pre fe re nc es > M-Lint.InSelect messages to enable,clear
the check box for messages you do not want to see. Review the settings
forallmessagestoensureyouareseeingthosepertinenttoyourfile.
Click OK. For more information, click the Help buttonintheM-Lint
Preferences pane. The next time you run the report, the messages
will not appear. You can use
%#ok with a specific message ID so that
only that type of messag e is suppressed—for more inform ation, see the
reference page for
mlint.
5 After making changes, save the M-file. C onsider saving the file to a
different name if you made sig n ificant changes that might introduce errors.
Then you can refer to the original file if needed to resolve problems with
the updated file. U se Tools > Compare Against in the Editor/Debugger
to help you identify the changes you made to the file. For more information,
see “Comparing Files File Comparison Tool” on page 6-54.
6 Run and debug the file(s) again to be sure you have not introduced any
inadvertent errors.
7 IftheM-LintCodeCheckReportisalreadydisplayed,clickRerun This
Report to update the report based on the changes you made to the file, or
run the report from the Current Directory brow ser toolbar. Ensure the
M-Lint messages are gone, based on the changes you made to the M-files.
Making Changes Based on M-Lint Messages
For information on how to correct the potential problems presente d by M-Lint,
use the fo llowing resources:
L ook for relevant topics in the MATLAB Programming and “Pro gramming
Tips” documentation.
7-18